diff options
| author | Dong Aisheng <aisheng.dong@nxp.com> | 2017-04-11 21:58:42 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2017-04-11 16:35:54 -0400 |
| commit | 7f51cf2ea7186e3f217e616a5522f1156678356f (patch) | |
| tree | 44fa0f5e40ec3d6ca5b1c8cd9d5f657c9c6d76d4 /drivers/regulator | |
| parent | d00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff) | |
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) | |||
| 200 | rdesc->owner = THIS_MODULE; | 200 | rdesc->owner = THIS_MODULE; |
| 201 | 201 | ||
| 202 | initdata = of_get_regulator_init_data(dev, np, rdesc); | 202 | initdata = of_get_regulator_init_data(dev, np, rdesc); |
| 203 | if (!initdata) | ||
| 204 | return -ENOMEM; | ||
| 205 | |||
| 203 | initdata->supply_regulator = "vin"; | 206 | initdata->supply_regulator = "vin"; |
| 204 | sreg->initdata = initdata; | 207 | sreg->initdata = initdata; |
| 205 | 208 | ||
