bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port()

__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: ed69bdd8fd ("drivers: bus: add ARM CCI support")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Link: https://lore.kernel.org/r/20260923164122.596910-1-oss.patchbox@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Yuho Choi 2026-09-23 12:40:55 -04:00 committed by Arnd Bergmann
parent 41d6c0fcd4
commit 810ccc7921
No known key found for this signature in database
GPG Key ID: 9A6C79EFE60018D9

View File

@ -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;
}