* [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup
@ 2026-05-25 3:38 Yuho Choi
2026-06-26 2:21 ` 최유호
2026-07-22 13:53 ` Andrew Jeffery
0 siblings, 2 replies; 3+ messages in thread
From: Yuho Choi @ 2026-05-25 3:38 UTC (permalink / raw)
To: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry
Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, Russell King,
openbmc, linux-arm-kernel, linux-kernel, Yuho Choi
npcm7xx_smp_boot_secondary() and npcm7xx_smp_prepare_cpus() look up
the GCR and SCU nodes with of_find_compatible_node(). The returned
nodes are used for of_iomap(), but the node references are never
released.
of_iomap() does not consume the device node reference, and iounmap()
only releases the MMIO mapping. Drop each node reference after the
corresponding mapping attempt.
Fixes: 7bffa14c9aed ("arm: npcm: add basic support for Nuvoton BMCs")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
arch/arm/mach-npcm/platsmp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c
index 41891d3aa124..4c1fc9983746 100644
--- a/arch/arm/mach-npcm/platsmp.c
+++ b/arch/arm/mach-npcm/platsmp.c
@@ -32,6 +32,7 @@ static int npcm7xx_smp_boot_secondary(unsigned int cpu,
goto out;
}
gcr_base = of_iomap(gcr_np, 0);
+ of_node_put(gcr_np);
if (!gcr_base) {
pr_err("could not iomap gcr");
ret = -ENOMEM;
@@ -60,6 +61,7 @@ static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)
return;
}
scu_base = of_iomap(scu_np, 0);
+ of_node_put(scu_np);
if (!scu_base) {
pr_err("could not iomap scu");
return;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup
2026-05-25 3:38 [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup Yuho Choi
@ 2026-06-26 2:21 ` 최유호
2026-07-22 13:53 ` Andrew Jeffery
1 sibling, 0 replies; 3+ messages in thread
From: 최유호 @ 2026-06-26 2:21 UTC (permalink / raw)
To: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry
Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, Russell King,
openbmc, linux-arm-kernel, linux-kernel
Hi,
Just a gentle ping on this patch.
I would appreciate any feedback when you have a chance to review this.
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup
2026-05-25 3:38 [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup Yuho Choi
2026-06-26 2:21 ` 최유호
@ 2026-07-22 13:53 ` Andrew Jeffery
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Jeffery @ 2026-07-22 13:53 UTC (permalink / raw)
To: Avi Fishman, Tomer Maimon, Tali Perry, Yuho Choi
Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, Russell King,
openbmc, linux-arm-kernel, linux-kernel
On Sun, 24 May 2026 23:38:46 -0400, Yuho Choi wrote:
> npcm7xx_smp_boot_secondary() and npcm7xx_smp_prepare_cpus() look up
> the GCR and SCU nodes with of_find_compatible_node(). The returned
> nodes are used for of_iomap(), but the node references are never
> released.
>
> of_iomap() does not consume the device node reference, and iounmap()
> only releases the MMIO mapping. Drop each node reference after the
> corresponding mapping attempt.
>
> [...]
Thanks, I've applied this to the BMC tree.
--
Andrew Jeffery <andrew@codeconstruct.com.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-22 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-25 3:38 [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup Yuho Choi
2026-06-26 2:21 ` 최유호
2026-07-22 13:53 ` Andrew Jeffery
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®