summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2017-04-12 04:58:42 +0300
committerMark Brown <broonie@kernel.org>2017-04-11 23:35:54 +0300
commit7f51cf2ea7186e3f217e616a5522f1156678356f (patch)
tree44fa0f5e40ec3d6ca5b1c8cd9d5f657c9c6d76d4 /drivers/regulator
parentd00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff)
downloadlinux-7f51cf2ea7186e3f217e616a5522f1156678356f.tar.xz
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;