All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: versatile: Fix refcount leak in ap_init_of
@ 2022-06-05  8:48 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-06-05  8:48 UTC (permalink / raw)
  To: Linus Walleij, Russell King, Arnd Bergmann, linux-arm-kernel,
	linux-kernel
  Cc: linmq006

of_find_matching_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: e67ae6be734d ("ARM: integrator: hook the AP into the SoC bus")
Fixes: df36680f1a71 ("ARM: integrator: core module registers from compatible strings")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/arm/mach-versatile/integrator_ap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-versatile/integrator_ap.c b/arch/arm/mach-versatile/integrator_ap.c
index e216fac917d0..6b2a69acc6b0 100644
--- a/arch/arm/mach-versatile/integrator_ap.c
+++ b/arch/arm/mach-versatile/integrator_ap.c
@@ -175,6 +175,7 @@ static void __init ap_init_of(void)
 	if (!syscon)
 		return;
 	ap_syscon_map = syscon_node_to_regmap(syscon);
+	of_node_put(syscon);
 	if (IS_ERR(ap_syscon_map)) {
 		pr_crit("could not find Integrator/AP system controller\n");
 		return;
-- 
2.25.1


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

* [PATCH] ARM: versatile: Fix refcount leak in ap_init_of
@ 2022-06-05  8:48 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-06-05  8:48 UTC (permalink / raw)
  To: Linus Walleij, Russell King, Arnd Bergmann, linux-arm-kernel,
	linux-kernel
  Cc: linmq006

of_find_matching_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: e67ae6be734d ("ARM: integrator: hook the AP into the SoC bus")
Fixes: df36680f1a71 ("ARM: integrator: core module registers from compatible strings")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/arm/mach-versatile/integrator_ap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-versatile/integrator_ap.c b/arch/arm/mach-versatile/integrator_ap.c
index e216fac917d0..6b2a69acc6b0 100644
--- a/arch/arm/mach-versatile/integrator_ap.c
+++ b/arch/arm/mach-versatile/integrator_ap.c
@@ -175,6 +175,7 @@ static void __init ap_init_of(void)
 	if (!syscon)
 		return;
 	ap_syscon_map = syscon_node_to_regmap(syscon);
+	of_node_put(syscon);
 	if (IS_ERR(ap_syscon_map)) {
 		pr_crit("could not find Integrator/AP system controller\n");
 		return;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: versatile: Fix refcount leak in ap_init_of
  2022-06-05  8:48 ` Miaoqian Lin
@ 2022-06-15 13:47   ` Linus Walleij
  -1 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2022-06-15 13:47 UTC (permalink / raw)
  To: Miaoqian Lin; +Cc: Russell King, Arnd Bergmann, linux-arm-kernel, linux-kernel

On Sun, Jun 5, 2022 at 10:49 AM Miaoqian Lin <linmq006@gmail.com> wrote:

> of_find_matching_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: e67ae6be734d ("ARM: integrator: hook the AP into the SoC bus")
> Fixes: df36680f1a71 ("ARM: integrator: core module registers from compatible strings")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Patch applied!

Yours,
Linus Walleij

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

* Re: [PATCH] ARM: versatile: Fix refcount leak in ap_init_of
@ 2022-06-15 13:47   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2022-06-15 13:47 UTC (permalink / raw)
  To: Miaoqian Lin; +Cc: Russell King, Arnd Bergmann, linux-arm-kernel, linux-kernel

On Sun, Jun 5, 2022 at 10:49 AM Miaoqian Lin <linmq006@gmail.com> wrote:

> of_find_matching_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: e67ae6be734d ("ARM: integrator: hook the AP into the SoC bus")
> Fixes: df36680f1a71 ("ARM: integrator: core module registers from compatible strings")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Patch applied!

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-06-15 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-05  8:48 [PATCH] ARM: versatile: Fix refcount leak in ap_init_of Miaoqian Lin
2022-06-05  8:48 ` Miaoqian Lin
2022-06-15 13:47 ` Linus Walleij
2022-06-15 13:47   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.