Re: [PATCH v2] leds: sgm3140: Put the child node reference on success

From: Nguyễn Công

Date: Fri Nov 27 2026 - 02:23:10 EST


On Thu, Nov 26, 2026 at 8:46 PM Markus Elfring <Markus.Elfring@xxxxxx> wrote:
>
> …
> > +++ b/drivers/leds/flash/leds-sgm3140.c
> …
> > @@ -270,12 +270,10 @@ static int sgm3140_probe(struct platform_device *pdev)
> > &v4l2_sd_cfg);
> > if (IS_ERR(priv->v4l2_flash)) {
> > ret = PTR_ERR(priv->v4l2_flash);
> > - goto err;
> > + goto out_put_node;
>
> Is such a jump to an immediately following statement redundant?
Hi Markus,
Yes, v3 drops it. It also keeps the label name, because v2 did not build
on the leds tree:
https://lore.kernel.org/r/20261127071831.136694-1-congnt264@xxxxxxxxx
>
>
> > }
> >
> > - return ret;
> > -
> > -err:
> > +out_put_node:
> > fwnode_handle_put(child_node);
> > return ret;
> > }
>
> Under which circumstances would you become interested to apply the attribute “__free(fwnode_handle)”?
> https://elixir.bootlin.com/linux/v7.4-rc1/source/include/linux/property.h#L229

For new code, or a cleanup on top of a merged fix. This patch carries a
Fixes tag and may be backported, and the helper only exists since v6.10,
so I kept the fix minimal.

Thanks,
Cong

>
> Regards,
> Markus