[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200925235541.GA28030@agrajag.zerfleddert.de>
Date: Sat, 26 Sep 2020 01:55:41 +0200
From: Tobias Jordan <kernel@...e.de>
To: Linus Walleij <linus.walleij@...aro.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] 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")
Signed-off-by: Tobias Jordan <kernel@...e.de>
---
drivers/bus/arm-integrator-lm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index 845b6c43fef8..cb6da80d1c7d 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -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;
}
--
2.20.1
Powered by blists - more mailing lists