Skip to contentSkip to conversation

bus: arm: integrator: fix device node iterator leak

PATCH In review Tobias Jordan 2 participants 2 messages Sep 25, 2020 – Sep 30, 2020 Arm integrator, versatile and realview support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: arm: integrator: fix device node iterator leak

In the for_each_available_child_of_node loop of integrator_lm_populate, add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
---
 drivers/bus/arm-integrator-lm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/arm-integrator-lm.c +1 -0
index 845b6c43fef8..cb6da80d1c7d 100644
@@ -53,6 +53,7 @@ static int integrator_lm_populate(int num, struct device *dev)
 				 base);
 			ret = of_platform_default_populate(child, NULL, dev);
 			if (ret) {
+				of_node_put(child);
 				dev_err(dev, "failed to populate module\n");
 				return ret;
 			}
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Tobias Jordan

In the for_each_available_child_of_node loop of integrator_lm_populate, add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")

Incidentally, Sumera Priyadarsini has already fixed this. Thanks anyway!

Yours,
Linus Walleij