All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl/rockchip: Fix refcount leak bug
@ 2022-06-19  7:33 ` Liang He
  0 siblings, 0 replies; 6+ messages in thread
From: Liang He @ 2022-06-19  7:33 UTC (permalink / raw)
  To: linus.walleij, heiko; +Cc: windhl, linux-gpio, linux-arm-kernel, linux-rockchip

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.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 32e41395fc76..d78827c97760 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -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;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-22  8:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-19  7:33 [PATCH] pinctrl/rockchip: Fix refcount leak bug Liang He
2022-06-19  7:33 ` Liang He
2022-06-19  7:33 ` Liang He
2022-06-22  8:58 ` Krzysztof Kozlowski
2022-06-22  8:58   ` Krzysztof Kozlowski
2022-06-22  8:58   ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.