summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2015-11-26 17:05:07 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:03:11 -0600
commitbc714b8372485918d3240635b7439164f0d9b467 (patch)
tree34bcf1604d2537007876fdc3c6822315e5875f39 /drivers/regulator
parentd59e4e631fd6e011c6803d6f77b4d711794a35dd (diff)
MLK-11909-2 regulator: anatop-regulator: Dereference null return value (NULL_RETURNS)
Dereference null return value (NULL_RETURNS). Signed-off-by: Robin Gong <b38343@freescale.com> (cherry picked from commit e5d41f4bbded2f2b948a13d4dc04596cd896b072)
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/anatop-regulator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 5b5ab0a3ec84..76806f9e06cf 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -241,6 +241,12 @@ static int anatop_regulator_probe(struct platform_device *pdev)
if (!sreg)
return -ENOMEM;
sreg->name = of_get_property(np, "regulator-name", NULL);
+
+ if (!sreg->name) {
+ dev_err(dev, "no regulator-name set\n");
+ return -EINVAL;
+ }
+
rdesc = &sreg->rdesc;
rdesc->name = sreg->name;
rdesc->type = REGULATOR_VOLTAGE;