Commit 63ff545a authored by Wang Yufen's avatar Wang Yufen Committed by Bartosz Golaszewski

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: 936ee267 ("gpio/rockchip: add driver for rockchip gpio")
Signed-off-by: default avatarWang Yufen <wangyufen@huawei.com>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 45fecdb9
...@@ -610,6 +610,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank) ...@@ -610,6 +610,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
return -ENODATA; return -ENODATA;
pctldev = of_pinctrl_get(pctlnp); pctldev = of_pinctrl_get(pctlnp);
of_node_put(pctlnp);
if (!pctldev) if (!pctldev)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment