[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220615082940.3960612-1-windhl@126.com>
Date: Wed, 15 Jun 2022 16:29:40 +0800
From: heliang <windhl@....com>
To: linus.walleij@...aro.org, mturquette@...libre.com, sboyd@...nel.org
Cc: linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, windhl@....com
Subject: [PATCH] drivers: clk: Add missing of_node_put() in clk-nomadik.c
In nomadik_src_init, of_find_matching_node() return a node pointer
with refcount incremented. We should use of_node_put() in fail path
or when it is not used anymore.
Signed-off-by: heliang <windhl@....com>
---
drivers/clk/clk-nomadik.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index bad2677e11ae..b3b8855d8890 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -97,6 +97,7 @@ static void __init nomadik_src_init(void)
}
src_base = of_iomap(np, 0);
if (!src_base) {
+ of_node_put(np);
pr_err("%s: must have src parent node with REGS (%pOFn)\n",
__func__, np);
return;
@@ -130,6 +131,7 @@ static void __init nomadik_src_init(void)
val &= ~SRC_XTALCR_MXTALEN;
pr_info("disabling MXTALO\n");
}
+ of_node_put(np);
writel(val, src_base + SRC_XTALCR);
register_reboot_notifier(&nomadik_clk_reboot_notifier);
}
--
2.25.1
Powered by blists - more mailing lists