From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH -next] gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe()
Date: Tue, 21 Dec 2021 16:22:22 +0100 [thread overview]
Message-ID: <CAMRc=Md7xfn5-XtbVs_sEWt7YtdzMF0eUCqUME4_W6Bxv4d84g@mail.gmail.com> (raw)
In-Reply-To: <20211221113825.334782-1-yangyingliang@huawei.com>
On Tue, Dec 21, 2021 at 12:32 PM Yang Yingliang
<yangyingliang@huawei.com> wrote:
>
> Calling fwnode_handle_put() when break out of device_for_each_child_node(),
> or the device node reference will be leakd.
>
> Fixes: 83960fcf4818 ("gpio: sim: new testing module")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/gpio/gpio-sim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index ef6145f51c8a..520ee923b516 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -444,8 +444,10 @@ static int gpio_sim_probe(struct platform_device *pdev)
>
> device_for_each_child_node(dev, swnode) {
> ret = gpio_sim_add_bank(swnode, dev);
> - if (ret)
> + if (ret) {
> + fwnode_handle_put(swnode);
> return ret;
> + }
> }
>
> return 0;
> --
> 2.25.1
>
Applied, thanks!
Bart
prev parent reply other threads:[~2021-12-21 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 11:38 [PATCH -next] gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe() Yang Yingliang
2021-12-21 15:22 ` Bartosz Golaszewski [this message]
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='CAMRc=Md7xfn5-XtbVs_sEWt7YtdzMF0eUCqUME4_W6Bxv4d84g@mail.gmail.com' \
--to=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).