[PATCH 09/18] leds: lm3697: switch to device_for_each_child_node_scoped()

Andy Shevchenko andy.shevchenko at gmail.com
Sat Nov 23 11:37:59 PST 2024


Fri, Sep 27, 2024 at 01:21:00AM +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 'child_out', as an immediate return is possible.

Same here and so on...
So, please revisit these drivers for the possible improvements.

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-mediatek mailing list