projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d00b746
)
regulator: anatop: check return value of of_get_regulator_init_data
author
Dong Aisheng
<aisheng.dong@nxp.com>
Wed, 12 Apr 2017 01:58:42 +0000
(09:58 +0800)
committer
Mark Brown
<broonie@kernel.org>
Tue, 11 Apr 2017 20:35:54 +0000
(21:35 +0100)
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>
drivers/regulator/anatop-regulator.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/regulator/anatop-regulator.c
b/drivers/regulator/anatop-regulator.c
index 3a6d0290c54c0fbd0f1c82ffcd5329c2facc56ae..aa93f462ac6eadae9f612472370c5c89e26a0eab 100644
(file)
--- 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;