From: Yang Yingliang <yangyingliang@huaweicloud.com>
To: linux-gpio@vger.kernel.org
Cc: linus.walleij@linaro.org, dan.carpenter@linaro.org,
tony@atomide.com, haojian.zhuang@linaro.org, liwei391@huawei.com,
yangyingliang@huawei.com
Subject: [PATCH] pinctrl: single: fix missing error code in pcs_probe()
Date: Mon, 19 Aug 2024 10:46:25 +0800 [thread overview]
Message-ID: <20240819024625.154441-1-yangyingliang@huaweicloud.com> (raw)
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
next reply other threads:[~2024-08-19 3:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 2:46 Yang Yingliang [this message]
2024-08-24 14:29 ` [PATCH] pinctrl: single: fix missing error code in pcs_probe() Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240819024625.154441-1-yangyingliang@huaweicloud.com \
--to=yangyingliang@huaweicloud.com \
--cc=dan.carpenter@linaro.org \
--cc=haojian.zhuang@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=tony@atomide.com \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).