From: Jon Hunter Date: Tue, 28 Jun 2016 10:38:27 +0000 (+0100) Subject: soc/tegra: pmc: Add missing of_node_put() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b69a625826ecc563414aea5846e31b05184292f4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 [treding@nvidia.com: squash in a couple more of_node_put() calls] Signed-off-by: Thierry Reding --- 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, ®s) < 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(®s)); 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;