[PATCH 11/18] leds: max77650: switch to device_for_each_child_node_scoped()

Bartosz Golaszewski brgl at bgdev.pl
Thu Sep 26 23:36:40 PDT 2024


On Fri, Sep 27, 2024 at 1:21 AM Javier Carrasco
<javier.carrasco.cruz at gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz at gmail.com>
> ---

Acked-by: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>



More information about the linux-arm-kernel mailing list