Re: [PATCH] pinctrl: imx1: fix device_node leak in dt_is_flat_functions()
From: Linus Walleij
Date: Thu Jun 25 2026 - 04:04:27 EST
On Sat, May 23, 2026 at 12:27 PM Felix Gu <ustc.gu@xxxxxxxxx> wrote:
> for_each_child_of_node() holds a reference on the iterator node that
> must be released on early return. imx1_pinctrl_dt_is_flat_functions()
> has two early return paths inside the loop that skip this cleanup.
>
> Replace both loops with the scoped variant so that the reference is
> automatically dropped when the iterator goes out of scope.
>
> Fixes: 63d2059cd665 ("pinctrl: imx1: Allow parsing DT without function nodes")
> Signed-off-by: Felix Gu <ustc.gu@xxxxxxxxx>
Patch applied for v7.3!
Yours,
Linus Walleij