projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e69af5e
)
regulator: Checking return value of of_get_regulator_init_data
author
Axel Lin
<axel.lin@gmail.com>
Sat, 26 Nov 2011 12:19:19 +0000
(20:19 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Sun, 27 Nov 2011 11:29:21 +0000
(11:29 +0000)
of_get_regulator_init_data() may return NULL, thus
check the return value to avoid NULL pointer dereference.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/fixed.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/fixed.c
b/drivers/regulator/fixed.c
index db90919f99c2da716c8dc6d3489e77ae8537df6c..2997f11af90553840520c9d4228b8541eec36fb3 100644
(file)
--- a/
drivers/regulator/fixed.c
+++ b/
drivers/regulator/fixed.c
@@
-64,6
+64,9
@@
struct fixed_voltage_config *of_get_fixed_voltage_config(struct device *dev)
return NULL;
config->init_data = of_get_regulator_init_data(dev);
+ if (!config->init_data)
+ return NULL;
+
init_data = config->init_data;
config->supply_name = init_data->constraints.name;