[PATCH] regulator: fix memory leak #2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix memory leak of propname.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux