All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Cong Nguyen" <congnt264@gmail.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v2] leds: rt4505: Put the child node reference
Date: Wed, 02 Dec 2026 18:17:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-246420@kernel.org> (raw)
In-Reply-To: <20261202181010.3742460-1-congnt264@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] leds: rt4505: __free() variable declared with NULL in
  rt4505_probe()
--

commit f451bac4aa9f75d2dcd5e7da6c09feb97bd7b1c8
Author: Cong Nguyen <congnt264@gmail.com>

leds: rt4505: Put the child node reference

This commit annotates the child fwnode_handle in rt4505_probe() with
__free(fwnode_handle) so that the reference returned by
device_get_next_child_node() is released when probe returns.

> diff --git a/drivers/leds/flash/leds-rt4505.c b/drivers/leds/flash/leds-rt4505.c
> index 6a47760645f11..111cf80cc9372 100644
> --- a/drivers/leds/flash/leds-rt4505.c
> +++ b/drivers/leds/flash/leds-rt4505.c
[ ... ]
> @@ -341,7 +342,7 @@ static void rt4505_init_flash_properties(struct rt4505_priv *priv,
>  static int rt4505_probe(struct i2c_client *client)
>  {
>  	struct rt4505_priv *priv;
> -	struct fwnode_handle *child;
> +	struct fwnode_handle *child __free(fwnode_handle) = NULL;
>  	struct led_init_data init_data = {};
>  	struct v4l2_flash_config v4l2_config = {};
>  	int ret;

[Severity: Low]
This isn't a bug, but per the cleanup.h convention, __free() variables
should be defined and initialized in a single statement at their point
of acquisition rather than declared with = NULL at the top of the
function:

	struct fwnode_handle *child __free(fwnode_handle) =
		device_get_next_child_node(&client->dev, NULL);

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

  reply	other threads:[~2026-12-02 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 18:10 [PATCH v2] leds: rt4505: Put the child node reference Cong Nguyen
2026-12-02 18:17 ` sashiko-bot [this message]
2026-12-02 18:47 ` Markus Elfring

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-246420@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=congnt264@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.