[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220605084854.29659-1-linmq006@gmail.com>
Date: Sun, 5 Jun 2022 12:48:54 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Russell King <linux@...linux.org.uk>,
Arnd Bergmann <arnd@...db.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] ARM: versatile: Fix refcount leak in ap_init_of
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@...il.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
Powered by blists - more mailing lists