From: Wang Yufen Date: Mon, 5 Dec 2022 06:19:56 +0000 (+0800) Subject: gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() X-Git-Tag: v5.15.92~1526 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cb8f1a784fd6115be58282fe15105572319d8be;p=platform%2Fkernel%2Flinux-rpi.git gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() [ Upstream commit 63ff545af73f759d1bd04198af8ed8577fb739fc ] The node returned by of_get_parent() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the end of of_pinctrl_get(). Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by: Wang Yufen Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index d32928c..a197f698 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -605,6 +605,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank) return -ENODATA; pctldev = of_pinctrl_get(pctlnp); + of_node_put(pctlnp); if (!pctldev) return -ENODEV;