Skip to content

Commit

Permalink
pinctrl: rockchip: Fix refcount leak in rockchip_pinctrl_parse_groups
Browse files Browse the repository at this point in the history
of_find_node_by_phandle() returns a node pointer with refcount incremented,
We should use of_node_put() on it when not needed anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: d3e5116 ("pinctrl: add pinctrl driver for Rockchip SoCs")
Signed-off-by: Miaoqian Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
Yuuoniy authored and linusw committed Jan 9, 2023
1 parent dcef18c commit c818ae5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pinctrl/pinctrl-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,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;
}
Expand Down

0 comments on commit c818ae5

Please sign in to comment.