Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Gene Chen <gene_chen@richtek.com>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 11/18] leds: max77650: switch to device_for_each_child_node_scoped()
Date: Sat, 23 Nov 2024 21:47:37 +0200	[thread overview]
Message-ID: <Z0IxWdV8ZWhJ5Pp4@surfacebook.localdomain> (raw)
In-Reply-To: <20240927-leds_device_for_each_child_node_scoped-v1-11-95c0614b38c8@gmail.com>

Fri, Sep 27, 2024 at 01:21:02AM +0200, Javier Carrasco kirjoitti:
> Switch to device_for_each_child_node_scoped() to simplify the code by
> removing the need for calls to fwnode_handle_put() in the error paths.
> 
> This also prevents possible memory leaks if new error paths are added
> without the required call to fwnode_handle_put().
> 
> After switching to the scoped variant, there is no longer need for a
> jump to 'err_node_out', as an immediate return is possible.

...

>  		rv = fwnode_property_read_u32(child, "reg", &reg);
> -		if (rv || reg >= MAX77650_LED_NUM_LEDS) {
> -			rv = -EINVAL;
> -			goto err_node_put;
> -		}
> +		if (rv || reg >= MAX77650_LED_NUM_LEDS)
> +			return -EINVAL;

Again (yes, I know that is original issue, but with your series applied
it may be nicely resolved), shadowing error code. Should be

		if (rv)
			return rv;
		if (reg >= MAX77650_LED_NUM_LEDS)
			return -EINVAL;

-- 
With Best Regards,
Andy Shevchenko




      parent reply	other threads:[~2024-11-23 19:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240927-leds_device_for_each_child_node_scoped-v1-0-95c0614b38c8@gmail.com>
2024-11-23 19:29 ` [PATCH 00/18] leds: switch to device_for_each_child_node_scoped() Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-5-95c0614b38c8@gmail.com>
2024-11-23 19:31   ` [PATCH 05/18] leds: cr0014114: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-6-95c0614b38c8@gmail.com>
2024-11-23 19:34   ` [PATCH 06/18] leds: el15203000: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-7-95c0614b38c8@gmail.com>
2024-11-23 19:35   ` [PATCH 07/18] leds: gpio: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-8-95c0614b38c8@gmail.com>
2024-11-23 19:37   ` [PATCH 08/18] leds: lm3532: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-9-95c0614b38c8@gmail.com>
2024-11-23 19:37   ` [PATCH 09/18] leds: lm3697: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-16-95c0614b38c8@gmail.com>
2024-11-23 19:40   ` [PATCH 16/18] leds: tca6507: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-15-95c0614b38c8@gmail.com>
2024-11-23 19:41   ` [PATCH 15/18] leds: sun50i-a100: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-13-95c0614b38c8@gmail.com>
2024-11-23 19:45   ` [PATCH 13/18] leds: pca963x: " Andy Shevchenko
     [not found] ` <20240927-leds_device_for_each_child_node_scoped-v1-11-95c0614b38c8@gmail.com>
2024-11-23 19:47   ` Andy Shevchenko [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=Z0IxWdV8ZWhJ5Pp4@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=brgl@bgdev.pl \
    --cc=gene_chen@richtek.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=matthias.bgg@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    /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