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

From: Markus Elfring

Date: Thu Nov 26 2026 - 08:47:26 EST


…
> +++ 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?


> }
>
> - 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

Regards,
Markus