Re: [PATCH] pinctrl: renesas: rzt2h: Fix device node leak in rzt2h_gpio_register()

From: Geert Uytterhoeven

Date: Thu Jan 29 2026 - 03:27:55 EST


Hi Linus,

On Wed, 28 Jan 2026 at 08:55, Linus Walleij <linusw@xxxxxxxxxx> wrote:
> On Mon, Jan 26, 2026 at 5:35 PM Felix Gu <ustc.gu@xxxxxxxxx> wrote:
>
> > + of_node_put(of_args.np);
> > if (of_args.args[0] != 0 || of_args.args[1] != 0 ||
> > of_args.args[2] != pctrl->data->n_port_pins)
> > return dev_err_probe(dev, -EINVAL,
>
> To me it's a bit odd to dereference .np and then use other parts of
> the args the next line but maybe that works.

The of_node pointer is not used at all. The code only needs to validate
the mapping numbers.

> Geert will decide on the patch.

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
i.e. will queue in renesas-pinctrl for v6.21.

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