* [PATCH v1] bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port()
@ 2026-09-23 16:40 Yuho Choi
2026-10-13 16:10 ` patchwork-bot+linux-soc
0 siblings, 1 reply; 2+ messages in thread
From: Yuho Choi @ 2026-09-23 16:40 UTC (permalink / raw)
To: Lorenzo Pieralisi, Arnd Bergmann
Cc: Nicolas Pitre, linux-arm-kernel, soc, linux-kernel, Yuho Choi
__cci_ace_get_port() looks up the device's "cci-control-port" node with
of_parse_phandle(), which returns the node with its reference count
raised, and only compares the pointer against the probed ports. Neither
the match nor the no-match return releases it.
Drop the reference on both paths once the comparison is done.
Fixes: ed69bdd8fd9b ("drivers: bus: add ARM CCI support")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
Found by code review; compile-tested only (multi_v7_defconfig, W=1).
drivers/bus/arm-cci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 7f2baf0571286..223b1fe19ba06 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -167,9 +167,12 @@ static int __cci_ace_get_port(struct device_node *dn, int type)
cci_portn = of_parse_phandle(dn, "cci-control-port", 0);
for (i = 0; i < nb_cci_ports; i++) {
ace_match = ports[i].type == type;
- if (ace_match && cci_portn == ports[i].dn)
+ if (ace_match && cci_portn == ports[i].dn) {
+ of_node_put(cci_portn);
return i;
+ }
}
+ of_node_put(cci_portn);
return -ENODEV;
}
base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port()
2026-09-23 16:40 [PATCH v1] bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port() Yuho Choi
@ 2026-10-13 16:10 ` patchwork-bot+linux-soc
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-soc @ 2026-10-13 16:10 UTC (permalink / raw)
To: Yuho Choi; +Cc: soc
Hello:
This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:
On Wed, 23 Sep 2026 12:40:55 -0400 you wrote:
> __cci_ace_get_port() looks up the device's "cci-control-port" node with
> of_parse_phandle(), which returns the node with its reference count
> raised, and only compares the pointer against the probed ports. Neither
> the match nor the no-match return releases it.
>
> Drop the reference on both paths once the comparison is done.
>
> [...]
Here is the summary with links:
- [v1] bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port()
https://git.kernel.org/soc/soc/c/810ccc792193
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-13 16:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23 16:40 [PATCH v1] bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port() Yuho Choi
2026-10-13 16:10 ` patchwork-bot+linux-soc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox