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().
Unified · Split
| @@ -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; |