* [PATCH] regulator: fix memory leak #2
@ 2022-03-01 8:46 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2022-03-01 8:46 UTC (permalink / raw)
To: Barebox List
Fix memory leak of propname.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/regulator/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d3c43ce9a3..827ccee9d5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -197,14 +197,14 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c
struct device_node *node, *node_parent;
int ret;
- propname = basprintf("%s-supply", supply);
-
/*
* If the device does have a device node return the dummy regulator.
*/
if (!dev->device_node)
return NULL;
+ propname = basprintf("%s-supply", supply);
+
/*
* If the device node does not contain a supply property, this device doesn't
* need a regulator. Return the dummy regulator in this case.
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-01 8:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 8:46 [PATCH] regulator: fix memory leak #2 Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox