Skip to content

Commit

Permalink
ARM: bcm: Fix refcount leak in bcm_kona_smc_init
Browse files Browse the repository at this point in the history
[ Upstream commit cb23389 ]

of_find_matching_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: b8eb35f ("ARM: bcm281xx: Add L2 cache enable code")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed Aug 17, 2022
1 parent 1f4bc06 commit bc7f487
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-bcm/bcm_kona_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int __init bcm_kona_smc_init(void)
return -ENODEV;

prop_val = of_get_address(node, 0, &prop_size, NULL);
of_node_put(node);
if (!prop_val)
return -EINVAL;

Expand Down

0 comments on commit bc7f487

Please sign in to comment.