Linux LED subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Selby Mashiki" <mashikiselby@gmail.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH] leds: lp50xx, max77705: use fwnode_for_each_child_node_scoped() to fix fwnode leaks
Date: Sun, 25 Oct 2026 19:14:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-184357@kernel.org> (raw)
In-Reply-To: <20261025190331.449462-1-mashikiselby@gmail.com>

> In lp50xx_probe_dt(), the inner fwnode_for_each_child_node(child,
> led_node) loop returns -EINVAL on two error paths (when reading "reg"
> fails or multi_index is out of bounds) without calling
> fwnode_handle_put(led_node), leaking the child reference.
> 
> Similarly, in max77705_add_led(), fwnode_for_each_child_node(np, child)
> returns early when max77705_parse_subled() fails without calling
> fwnode_handle_put(child).
> 
> Switch both loops to fwnode_for_each_child_node_scoped() and drop the
> manual fwnode_handle_put() and loop cursor declarations so references
> are automatically released on all exit paths.
> 
> Fixes: 242b81170fb8 ("leds: lp50xx: Add the LP50XX family of the RGB LED driver")
> Fixes: aebb5fc9a0d8 ("leds: max77705: Add LEDs support")
> Signed-off-by: Selby Mashiki <mashikiselby@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025190331.449462-1-mashikiselby@gmail.com?part=1


      reply	other threads:[~2026-10-25 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 19:03 [PATCH] leds: lp50xx, max77705: use fwnode_for_each_child_node_scoped() to fix fwnode leaks Selby Mashiki
2026-10-25 19:14 ` sashiko-bot [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=sashiko-outbox-184357@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mashikiselby@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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