From: Marek Behun <marek.behun@nic.cz>
To: Tobias Jordan <kernel@cdqe.de>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>
Subject: Re: [PATCH] leds: lp55xx: fix device node iterator memory leaks
Date: Sat, 26 Sep 2020 01:16:12 +0200 [thread overview]
Message-ID: <20200926011612.37a50904@nic.cz> (raw)
In-Reply-To: <20200925225905.GA11731@agrajag.zerfleddert.de>
On Sat, 26 Sep 2020 00:59:05 +0200
Tobias Jordan <kernel@cdqe.de> wrote:
> Fix error paths in for_each_child_of_node loops that were missing an
> of_node_put call.
>
> Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to
> lp55xx")
> Signed-off-by: Tobias Jordan <kernel@cdqe.de>
> ---
> drivers/leds/leds-lp55xx-common.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
> index 56210f4ad919..f8b55cfd21ef 100644
> --- a/drivers/leds/leds-lp55xx-common.c
> +++ b/drivers/leds/leds-lp55xx-common.c
> @@ -614,8 +614,10 @@ static int lp55xx_parse_multi_led(struct device_node *np,
> for_each_child_of_node(np, child) {
> ret = lp55xx_parse_multi_led_child(child, cfg, child_number,
> num_colors);
> - if (ret)
> + if (ret) {
> + of_node_put(child);
> return ret;
> + }
> num_colors++;
> }
>
> @@ -681,8 +683,10 @@ struct lp55xx_platform_data *lp55xx_of_populate_pdata(struct device *dev,
>
> for_each_child_of_node(np, child) {
> ret = lp55xx_parse_logical_led(child, cfg, i);
> - if (ret)
> + if (ret) {
> + of_node_put(child);
> return ERR_PTR(-EINVAL);
> + }
> i++;
> }
>
This is already patched
prev parent reply other threads:[~2020-09-25 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 22:59 [PATCH] leds: lp55xx: fix device node iterator memory leaks Tobias Jordan
2020-09-25 23:16 ` Marek Behun [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=20200926011612.37a50904@nic.cz \
--to=marek.behun@nic.cz \
--cc=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=kernel@cdqe.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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