From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23FE9C61DB3 for ; Tue, 10 Jan 2023 16:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=U9rCMgXXpFXsPyDn28iagNuchuQgjLKj89hwItOQhJc=; b=HNJy5NRtGFg3br Y6hT4YtJ7iwTDtefvJGy+wvH+8UaHnzEVKHlJah9S0pZ7Kv/J6VkI00wIQhVH1Jkdfcwyp+XHFeJK 7VISsXl80pbT3Pd57jpUDpVKKuVYV119IkqDU8h6aYx5PAOrM6XeLvvzKxVnIzsiWvdJPRCPNs6Ry 7NFKRKYJbuWRhSpUATZ9fOaVxaFsgloXdB7Ca91SrQkW1y61nKz9SzU+t5N/ZGQ3p5zC0oPdPd3V8 MRqpTLm72nYfIa+r3YgNzI4KN+LCXN2CGQ601+UmWiCzP7bCivjn4lSDZoXM5+tUustz8YpXvrXsf itni5gAM4RSSyRJ1NQmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFHtS-007sZw-Vt; Tue, 10 Jan 2023 16:54:35 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFHtP-007sXt-W5 for linux-arm-kernel@lists.infradead.org; Tue, 10 Jan 2023 16:54:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k5HgYl9NgUrUWdRPEuTXuIY2b01cj9mbpmo7qfLmfhE=; b=xWMopqrld+pt37VLzMg1JQ/zZC PcVV6UiQv34nFAMNi1ZikgNSz953j/DyasV3eAmb+jW9QAgWbZ3gJa/xmb58oSThSFlVEW92WAuMM fNoX+7OKqnG66gIXMzgd4m1aUQMt1e+jfjrXJAp00BYteiJ7rebmoJzVEyKn0dxWcE/8hjpoPx5yu WqqpmjpkdFPgXarWTyyshfqjGEy1VD0j6gxx4o3L1X+DMxU9AwRoqXnuq7fuRSUNw4+EYkU1xfgqm 3HBMjgbhTc2yXvzPv9dZGphhgGUhov/h3kWdBB0HQgC3Kjv+DLpO8cwCUuHZQwK7tfB5XmijBhN2F f7PThzog==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36042) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pFHtM-0004CV-2R; Tue, 10 Jan 2023 16:54:27 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pFHtL-0000SY-3Z; Tue, 10 Jan 2023 16:54:27 +0000 Date: Tue, 10 Jan 2023 16:54:27 +0000 From: "Russell King (Oracle)" To: Srinivas Kandagatla Cc: linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] nvmem: core: fix return value Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230110_085432_051190_30AE7128 X-CRM114-Status: GOOD ( 22.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 10, 2023 at 04:50:05PM +0000, Srinivas Kandagatla wrote: > Hi Russell, > > On 10/01/2023 16:48, Russell King (Oracle) wrote: > > Dan Carpenter points out that the return code was not set in commit > > 60c8b4aebd8e ("nvmem: core: fix cleanup after dev_set_name()"), but > > this is not the only issue - we also need to zero wp_gpio to prevent > > gpiod_put() being called on an error value. > > > > Reported-by: kernel test robot > > Reported-by: Dan Carpenter > > Fixes: 60c8b4aebd8e ("nvmem: core: fix cleanup after dev_set_name()") > > Signed-off-by: Russell King (Oracle) > > --- > > drivers/nvmem/core.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > > index 082cda7ac199..1ee2e9255f7b 100644 > > --- a/drivers/nvmem/core.c > > +++ b/drivers/nvmem/core.c > > @@ -781,8 +781,11 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) > > if (!config->ignore_wp) > > nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", > > GPIOD_OUT_HIGH); > > - if (IS_ERR(nvmem->wp_gpio)) > > + if (IS_ERR(nvmem->wp_gpio)) { > > + rval = PTR_ERR(nvmem->wp_gpio); > > + nvmem->wp_gpio = NULL; > > goto err_put_device; > > I have already added this change while applying v3 patches. You still need wp_gpio to be NULL'd out, otherwise we'll end up calling gpiod_put() on the error-pointer. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel