Skip to content

Commit e825c79

Browse files
outman119geertu
authored andcommitted
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: 34d4d09 ("pinctrl: renesas: Add support for RZ/T2H") Signed-off-by: Felix Gu <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 6de23f8 commit e825c79

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/pinctrl/renesas/pinctrl-rzt2h.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ static int rzt2h_gpio_register(struct rzt2h_pinctrl *pctrl)
833833
if (ret)
834834
return dev_err_probe(dev, ret, "Unable to parse gpio-ranges\n");
835835

836+
of_node_put(of_args.np);
836837
if (of_args.args[0] != 0 || of_args.args[1] != 0 ||
837838
of_args.args[2] != pctrl->data->n_port_pins)
838839
return dev_err_probe(dev, -EINVAL,

0 commit comments

Comments
 (0)