linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch: arm: mach-versatile: Add missing of_node_put()
@ 2022-06-15  9:25 heliang
  0 siblings, 0 replies; 3+ messages in thread
From: heliang @ 2022-06-15  9:25 UTC (permalink / raw)
  To: linus.walleij, linux; +Cc: linux-arm-kernel, linux-kernel, windhl

In realview_smp_prepare_cpus(), the second of_find_matching_node()
has no corresponding of_node_put() when the node pointer is not
used anymore.

Signed-off-by: heliang <windhl@126.com>
---
 arch/arm/mach-versatile/platsmp-realview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-versatile/platsmp-realview.c b/arch/arm/mach-versatile/platsmp-realview.c
index 5d363385c801..059d796b26bc 100644
--- a/arch/arm/mach-versatile/platsmp-realview.c
+++ b/arch/arm/mach-versatile/platsmp-realview.c
@@ -66,6 +66,7 @@ static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
 		return;
 	}
 	map = syscon_node_to_regmap(np);
+	of_node_put(np);
 	if (IS_ERR(map)) {
 		pr_err("PLATSMP: No syscon regmap\n");
 		return;
-- 
2.25.1


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

* Re: [PATCH] arch: arm: mach-versatile: Add missing of_node_put()
  2022-06-15  9:29 heliang
@ 2023-09-13 12:12 ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2023-09-13 12:12 UTC (permalink / raw)
  To: heliang; +Cc: linux, linux-arm-kernel, linux-kernel

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

> In vexpress_smp_dt_prepare_cpus(), of_find_matching_node() will
> return a node pointer with refcount incremented. We should use
> of_node_put() when it is not used anymore.
>
> Signed-off-by: heliang <windhl@126.com>

Patch applied!

Yours,
Linus Walleij

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

* [PATCH] arch: arm: mach-versatile: Add missing of_node_put()
@ 2022-06-15  9:29 heliang
  2023-09-13 12:12 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: heliang @ 2022-06-15  9:29 UTC (permalink / raw)
  To: linus.walleij, linux; +Cc: linux-arm-kernel, linux-kernel, windhl

In vexpress_smp_dt_prepare_cpus(), of_find_matching_node() will
return a node pointer with refcount incremented. We should use
of_node_put() when it is not used anymore.

Signed-off-by: heliang <windhl@126.com>
---
 arch/arm/mach-versatile/platsmp-vexpress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-versatile/platsmp-vexpress.c b/arch/arm/mach-versatile/platsmp-vexpress.c
index 1ee3c45e71c9..459b5870de59 100644
--- a/arch/arm/mach-versatile/platsmp-vexpress.c
+++ b/arch/arm/mach-versatile/platsmp-vexpress.c
@@ -66,6 +66,8 @@ static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus)
 
 	if (scu)
 		scu_enable(of_iomap(scu, 0));
+	
+	of_node_put(scu);
 
 	/*
 	 * Write the address of secondary startup into the
-- 
2.25.1


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

end of thread, other threads:[~2023-09-13 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15  9:25 [PATCH] arch: arm: mach-versatile: Add missing of_node_put() heliang
2022-06-15  9:29 heliang
2023-09-13 12:12 ` 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).