From: sashiko-bot@kernel.org
To: "Miles Krause" <mileskrause5200@gmail.com>
Cc: lee@kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: lp8860: fix device_node leak in lp8860_probe()
Date: Thu, 10 Sep 2026 19:52:39 +0000 [thread overview]
Message-ID: <20260910195240.0E48B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260910-leds-lp8860-of-node-leak-v1-1-d333cff4345b@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The enable_gpio is initialized to logical low and never asserted, leaving the device permanently disabled.
--
commit fc2187284635f3278f3bb6af71e6925402976134
Author: Miles Krause <mileskrause5200@gmail.com>
leds: lp8860: fix device_node leak in lp8860_probe()
This commit fixes a device_node leak in lp8860_probe() by using the
__free(device_node) cleanup helper. It drops the manual management of
the reference returned by of_get_next_available_child().
> diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
> index 69f064781f699..f6e4227de903a 100644
> --- a/drivers/leds/leds-lp8860.c
> +++ b/drivers/leds/leds-lp8860.c
[ ... ]
> @@ -282,7 +282,8 @@ static int lp8860_probe(struct i2c_client *client)
> if (!led)
> return -ENOMEM;
>
> - child_node = of_get_next_available_child(np, NULL);
> + struct device_node *child_node __free(device_node) =
> + of_get_next_available_child(np, NULL);
> if (!child_node)
> return -EINVAL;
>
[Severity: High]
This isn't a bug introduced by this patch, but this is a pre-existing
issue in lp8860_probe(). Immediately following this lookup:
drivers/leds/leds-lp8860.c:lp8860_probe() {
...
enable_gpio = devm_gpiod_get_optional(&client->dev, "enable", GPIOD_OUT_LOW);
...
}
Does initializing the enable GPIO to logical low (GPIOD_OUT_LOW) leave the
device permanently disabled? The driver never seems to assert the GPIO to
high to enable the chip.
Other sibling drivers appear to correctly initialize their enable GPIO with
GPIOD_OUT_HIGH.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260910-leds-lp8860-of-node-leak-v1-1-d333cff4345b@gmail.com?part=1
prev parent reply other threads:[~2026-09-10 19:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 19:43 [PATCH] leds: lp8860: fix device_node leak in lp8860_probe() Miles Krause
2026-09-10 19:52 ` 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=20260910195240.0E48B1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mileskrause5200@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