Skip to contentSkip to conversation

pinctrl/rockchip: Fix refcount leak bug

PATCH In review Liang He 2 participants 2 messages Jun 19, 2022 – Jun 22, 2022

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 pinctrl/rockchip: Fix refcount leak bug

In rockchip_pinctrl_parse_groups(), we need a of_node_put() in each loop for the of_find_node_by_phandle() to keep the refcount balance.

---
 drivers/pinctrl/pinctrl-rockchip.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/pinctrl-rockchip.c +1 -0
index 32e41395fc76..d78827c97760 100644
@@ -2710,6 +2710,7 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
 		np_config = of_find_node_by_phandle(be32_to_cpup(phandle));
 		ret = pinconf_generic_parse_dt_config(np_config, NULL,
 				&grp->data[j].configs, &grp->data[j].nconfigs);
+		of_node_put(np_config);
 		if (ret)
 			return ret;
 	}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Liang He

In rockchip_pinctrl_parse_groups(), we need a of_node_put() in each loop for the of_find_node_by_phandle() to keep the refcount balance.

---
 drivers/pinctrl/pinctrl-rockchip.c | 1 +
 1 file changed, 1 insertion(+)

Before applying the patch please check it carefully. Previous evidence [1][2] suggests that not it was not even compiled.

[1] https://lore.kernel.org/all/[email protected]/

[2]
https://lore.kernel.org/all/[email protected]/

Best regards,
Krzysztof

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip