diff options
author | Wang Yufen <wangyufen@huawei.com> | 2022-12-05 14:19:56 +0800 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2022-12-06 10:10:46 +0100 |
commit | 63ff545af73f759d1bd04198af8ed8577fb739fc (patch) | |
tree | 37b035baf309fc21b156ea556723fec4f694a092 | |
parent | 45fecdb9f658d9c82960c98240bc0770ade19aca (diff) | |
download | linux-stable-63ff545af73f759d1bd04198af8ed8577fb739fc.tar.gz linux-stable-63ff545af73f759d1bd04198af8ed8577fb739fc.tar.bz2 linux-stable-63ff545af73f759d1bd04198af8ed8577fb739fc.zip |
gpio/rockchip: fix refcount leak in rockchip_gpiolib_register()
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 <wangyufen@huawei.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-rockchip.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index 870910bb9dd3..200e43a6f4b4 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -610,6 +610,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; |