[PATCH] pinctrl: renesas: rza1: Put fwnode after parsing gpio-ranges
From: Xiangwu Lai
Date: Wed Nov 11 2026 - 21:26:17 EST
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")
Signed-off-by: Xiangwu Lai <laixiangwu@xxxxxxxxxxxxxxxxxxxx>
---
drivers/pinctrl/renesas/pinctrl-rza1.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
index d2949e4db..76a61533f 100644
--- 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