Skip to content

Commit 37d838d

Browse files
Yuuoniyffainelli
authored andcommitted
soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe
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. In brcmstb_init_sram, it pass dn to of_address_to_resource(), of_address_to_resource() will call of_find_device_by_node() to take reference, so we should release the reference returned by of_find_matching_node(). Fixes: 0b741b8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Florian Fainelli <[email protected]>
1 parent f2906aa commit 37d838d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/soc/bcm/brcmstb/pm/pm-arm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
783783
}
784784

785785
ret = brcmstb_init_sram(dn);
786+
of_node_put(dn);
786787
if (ret) {
787788
pr_err("error setting up SRAM for PM\n");
788789
return ret;

0 commit comments

Comments
 (0)