aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2017-04-12 09:58:42 +0800
committerMark Brown <broonie@kernel.org>2017-04-11 21:35:54 +0100
commit7f51cf2ea7186e3f217e616a5522f1156678356f (patch)
tree44fa0f5e40ec3d6ca5b1c8cd9d5f657c9c6d76d4 /drivers/regulator
parentMerge remote-tracking branches 'regulator/topic/tps65086' and 'regulator/topic/twl' into regulator-next (diff)
downloadlinux-dev-7f51cf2ea7186e3f217e616a5522f1156678356f.tar.xz
linux-dev-7f51cf2ea7186e3f217e616a5522f1156678356f.zip
regulator: anatop: check return value of of_get_regulator_init_data
Should check the return value of of_get_regulator_init_data before using it. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/anatop-regulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 3a6d0290c54c..aa93f462ac6e 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -200,6 +200,9 @@ static int anatop_regulator_probe(struct platform_device *pdev)
rdesc->owner = THIS_MODULE;
initdata = of_get_regulator_init_data(dev, np, rdesc);
+ if (!initdata)
+ return -ENOMEM;
+
initdata->supply_regulator = "vin";
sreg->initdata = initdata;