linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: clk: Add missing of_node_put() in clk-nomadik.c
@ 2022-06-15  8:29 heliang
  2022-06-25 23:06 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: heliang @ 2022-06-15  8:29 UTC (permalink / raw)
  To: linus.walleij, mturquette, sboyd
  Cc: linux-arm-kernel, linux-clk, linux-kernel, windhl

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@126.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: clk: Add missing of_node_put() in clk-nomadik.c
  2022-06-15  8:29 [PATCH] drivers: clk: Add missing of_node_put() in clk-nomadik.c heliang
@ 2022-06-25 23:06 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-06-25 23:06 UTC (permalink / raw)
  To: heliang; +Cc: mturquette, sboyd, linux-arm-kernel, linux-clk, linux-kernel

On Wed, Jun 15, 2022 at 10:30 AM heliang <windhl@126.com> wrote:

> 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@126.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-25 23:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15  8:29 [PATCH] drivers: clk: Add missing of_node_put() in clk-nomadik.c heliang
2022-06-25 23:06 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).