linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: single: fix missing error code in pcs_probe()
@ 2024-08-19  2:46 Yang Yingliang
  2024-08-24 14:29 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2024-08-19  2:46 UTC (permalink / raw)
  To: linux-gpio
  Cc: linus.walleij, dan.carpenter, tony, haojian.zhuang, liwei391,
	yangyingliang

From: Yang Yingliang <yangyingliang@huawei.com>

If pinctrl_enable() fails in pcs_probe(), it should return the error code.

Fixes: 8f773bfbdd42 ("pinctrl: single: fix possible memory leak when pinctrl_enable() fails")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/pinctrl/pinctrl-single.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 4c6bfabb6bd7..fcac0c03905c 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1911,7 +1911,8 @@ static int pcs_probe(struct platform_device *pdev)
 
 	dev_info(pcs->dev, "%i pins, size %u\n", pcs->desc.npins, pcs->size);
 
-	if (pinctrl_enable(pcs->pctl))
+	ret = pinctrl_enable(pcs->pctl);
+	if (ret)
 		goto free;
 
 	return 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: single: fix missing error code in pcs_probe()
  2024-08-19  2:46 [PATCH] pinctrl: single: fix missing error code in pcs_probe() Yang Yingliang
@ 2024-08-24 14:29 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2024-08-24 14:29 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: linux-gpio, dan.carpenter, tony, haojian.zhuang, liwei391,
	yangyingliang

On Mon, Aug 19, 2024 at 4:51 AM Yang Yingliang
<yangyingliang@huaweicloud.com> wrote:

> From: Yang Yingliang <yangyingliang@huawei.com>
>
> If pinctrl_enable() fails in pcs_probe(), it should return the error code.
>
> Fixes: 8f773bfbdd42 ("pinctrl: single: fix possible memory leak when pinctrl_enable() fails")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Patch applied as nonurgent fix.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-24 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19  2:46 [PATCH] pinctrl: single: fix missing error code in pcs_probe() Yang Yingliang
2024-08-24 14:29 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).