Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: renesas: rzt2h: Fix device node leak in rzt2h_gpio_register()

When calling of_parse_phandle_with_fixed_args(), the caller is
responsible for calling of_node_put() to release the device node
reference.

In rzt2h_gpio_register(), the driver fails to call of_node_put() to
release the reference in of_args.np, which causes a memory leak.

Add the missing of_node_put() call to fix the leak.

Fixes: 34d4d093077a ("pinctrl: renesas: Add support for RZ/T2H")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260127-rzt2h-v1-1-86472e7421b8@gmail.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Felix Gu and committed by
Geert Uytterhoeven
e825c79e 6de23f81

+1
+1
drivers/pinctrl/renesas/pinctrl-rzt2h.c
··· 833 833 if (ret) 834 834 return dev_err_probe(dev, ret, "Unable to parse gpio-ranges\n"); 835 835 836 + of_node_put(of_args.np); 836 837 if (of_args.args[0] != 0 || of_args.args[1] != 0 || 837 838 of_args.args[2] != pctrl->data->n_port_pins) 838 839 return dev_err_probe(dev, -EINVAL,