* [PATCH] ARM: owl: smp: Fix refcount leak in s500_smp_prepare_cpus
@ 2022-03-09 10:15 Miaoqian Lin
0 siblings, 0 replies; only message in thread
From: Miaoqian Lin @ 2022-03-09 10:15 UTC (permalink / raw)
To: Andreas Färber, Manivannan Sadhasivam, Russell King,
linux-arm-kernel, linux-actions, linux-kernel
Cc: linmq006
The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.
Fixes: 172067e0bc87 ("ARM: owl: Implement CPU enable-method for S500")
Fixes: b6a0e18ca690 ("ARM: owl: smp: Implement SPS power-gating for CPU2 and CPU3")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/arm/mach-actions/platsmp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index f26618b43514..9fe9a0bd0fd0 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -103,6 +103,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}
timer_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!timer_base_addr) {
pr_err("%s: could not map timer registers\n", __func__);
return;
@@ -115,6 +116,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}
sps_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!sps_base_addr) {
pr_err("%s: could not map sps registers\n", __func__);
return;
@@ -128,6 +130,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}
scu_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!scu_base_addr) {
pr_err("%s: could not map scu registers\n", __func__);
return;
--
2.17.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] only message in thread
only message in thread, other threads:[~2022-03-09 10:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 10:15 [PATCH] ARM: owl: smp: Fix refcount leak in s500_smp_prepare_cpus Miaoqian Lin
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).