History

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().

Miaoqian Lin committed 4 years ago

Commit 37d838d1 parent f2906aa1 file · +1 −0Browse files

Unified · Split

drivers/soc/bcm/brcmstb/pm/pm-arm.c+1−0
@@ -783,6 +783,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev) · 782 unmodified lines
783 }783 }
784 784
785 ret = brcmstb_init_sram(dn);785 ret = brcmstb_init_sram(dn);
786 of_node_put(dn);
786 if (ret) {787 if (ret) {
787 pr_err("error setting up SRAM for PM\n");788 pr_err("error setting up SRAM for PM\n");
788 return ret;789 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t