Skip to content

Commit

Permalink
gpio/rockchip: fix refcount leak in rockchip_gpiolib_register()
Browse files Browse the repository at this point in the history
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: 936ee26 ("gpio/rockchip: add driver for rockchip gpio")
Signed-off-by: Wang Yufen <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
  • Loading branch information
wangyufen316 authored and Bartosz Golaszewski committed Dec 6, 2022
1 parent 45fecdb commit 63ff545
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpio/gpio-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 63ff545

Please sign in to comment.