summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-03-01 09:46:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-03-01 09:46:27 +0100
commit2e0f6c876f0e56d4133f02383380533856e53383 (patch)
tree956f8274dfd3cafd94ccd2724de3ac44e9201414 /drivers/regulator/core.c
parent348e12a87003d2776a5ffbe97652f2719b01159c (diff)
downloadbarebox-2e0f6c876f0e56d4133f02383380533856e53383.tar.gz
barebox-2e0f6c876f0e56d4133f02383380533856e53383.tar.xz
regulator: fix memory leak #2
Fix memory leak of propname. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c4
1 files 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.