Re: [PATCH] pinctrl: renesas: rza1: Put fwnode after parsing gpio-ranges
From: Geert Uytterhoeven
Date: Thu Nov 12 2026 - 05:37:28 EST
Hi Xiangwu,
Thanks for your patch!
You forgot to Cc Andy (and Jacopo, for the original bug).
On Thu, 12 Nov 2026 at 03:18, Xiangwu Lai
<laixiangwu@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> rza1_parse_gpiochip() parses the "gpio-ranges" property with
> fwnode_property_get_reference_args(), which takes a reference on the
> returned fwnode. The function only consumes the argument cells and
> never uses the fwnode itself, but neither the function nor its caller
> drops the reference, so one reference is leaked for every GPIO port.
>
> Release the reference right after the property has been parsed.
>
> Fixes: 5e455dd93397 ("pinctrl: renesas: rza1: Switch to use for_each_gpiochip_node() helper")
I will add
Fixes: 5a49b644b3075f88 ("pinctrl: Renesas RZ/A1 pin and gpio controller")
as the of_node_put() call was missing before the conversion to fwnode,
too.
> Signed-off-by: Xiangwu Lai <laixiangwu@xxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
i.e. will queue in renesas-pinctrl for v7.5.
> --- a/drivers/pinctrl/renesas/pinctrl-rza1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
> @@ -1183,6 +1183,7 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,
> list_name);
> return ret;
> }
> + fwnode_handle_put(args.fwnode);
>
> /*
> * Find out on which port this gpio-chip maps to by inspecting the
> --
> 2.50.1.windows.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds