diff options
author | Dong Aisheng <aisheng.dong@nxp.com> | 2017-04-12 09:58:42 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-04-11 21:35:54 +0100 |
commit | 7f51cf2ea7186e3f217e616a5522f1156678356f (patch) | |
tree | 44fa0f5e40ec3d6ca5b1c8cd9d5f657c9c6d76d4 /drivers/regulator | |
parent | d00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff) | |
download | linux-7f51cf2ea7186e3f217e616a5522f1156678356f.tar.bz2 |
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.c | 3 |
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; |