summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2016-06-28 12:38:27 +0200
committerThierry Reding <treding@nvidia.com>2016-06-30 12:23:08 +0200
commitb69a625826ecc563414aea5846e31b05184292f4 (patch)
tree7b034a2c342f534203814681400a113b757221d8 /drivers/soc
parentsoc/tegra: pmc: Ensure mutex is always initialised (diff)
downloadlinux-b69a625826ecc563414aea5846e31b05184292f4.tar.xz
linux-b69a625826ecc563414aea5846e31b05184292f4.zip
soc/tegra: pmc: Add missing of_node_put()
Add missing of_node_put() in PMC early initialisation function to avoid leaking the device nodes. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> [treding@nvidia.com: squash in a couple more of_node_put() calls] Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/tegra/pmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 483d54623ec5..48e1de2f7aeb 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void)
*/
if (of_address_to_resource(np, 0, &regs) < 0) {
pr_err("failed to get PMC registers\n");
+ of_node_put(np);
return -ENXIO;
}
}
@@ -1547,6 +1548,7 @@ static int __init tegra_pmc_early_init(void)
pmc->base = ioremap_nocache(regs.start, resource_size(&regs));
if (!pmc->base) {
pr_err("failed to map PMC registers\n");
+ of_node_put(np);
return -ENXIO;
}
@@ -1572,6 +1574,8 @@ static int __init tegra_pmc_early_init(void)
value &= ~PMC_CNTRL_INTR_POLARITY;
tegra_pmc_writel(value, PMC_CNTRL);
+
+ of_node_put(np);
}
return 0;