[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127104015.23839-10-srinivas.kandagatla@linaro.org>
Date: Fri, 27 Jan 2023 10:40:14 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
stable@...r.kernel.org, kernel test robot <lkp@...el.com>,
Dan Carpenter <error27@...il.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH 09/10] nvmem: core: fix return value
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
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.
Cc: stable@...r.kernel.org
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <error27@...il.com>
Fixes: 60c8b4aebd8e ("nvmem: core: fix cleanup after dev_set_name()")
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
drivers/nvmem/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 563116405b3d..34ee9d36ee7b 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -783,6 +783,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
GPIOD_OUT_HIGH);
if (IS_ERR(nvmem->wp_gpio)) {
rval = PTR_ERR(nvmem->wp_gpio);
+ nvmem->wp_gpio = NULL;
goto err_put_device;
}
--
2.25.1
Powered by blists - more mailing lists