[PATCH] bus: vexpress-config: Put bridge nodes after checking their phandles

Zhu Jun zhujun2 at cmss.chinamobile.com
Wed Nov 11 23:16:46 PST 2026


vexpress_syscfg_probe() obtains a config bridge node for each config
bus and only uses it for a pointer comparison. Neither the matching
path nor the continue path releases the reference.

Use scoped cleanup for the bridge node so each loop iteration releases
its lookup reference.

Fixes: a5a38765ac79 ("bus: vexpress-config: simplify config bus probing")
Signed-off-by: Zhu Jun <zhujun2 at cmss.chinamobile.com>
---
 drivers/bus/vexpress-config.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 9f57f6581b54..516a54fae850 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -390,9 +390,8 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	}
 
 	for_each_compatible_node(node, NULL, "arm,vexpress,config-bus") {
-		struct device_node *bridge_np;
-
-		bridge_np = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
+		struct device_node *bridge_np __free(device_node) =
+			of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
 		if (bridge_np != pdev->dev.parent->of_node)
 			continue;
 
-- 
2.51.0






More information about the linux-arm-kernel mailing list