diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-03-01 09:46:21 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-03-01 09:46:27 +0100 |
commit | 2e0f6c876f0e56d4133f02383380533856e53383 (patch) | |
tree | 956f8274dfd3cafd94ccd2724de3ac44e9201414 /drivers/regulator | |
parent | 348e12a87003d2776a5ffbe97652f2719b01159c (diff) | |
download | barebox-2e0f6c876f0e56d4133f02383380533856e53383.tar.gz |
regulator: fix memory leak #2
Fix memory leak of propname.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 4 |
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. |