aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-11-26 20:19:19 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-11 21:45:33 +0800
commit696e47632a829950a7a41b1d36b672a1da571fdf (patch)
tree9292f1e62c1e57a229006bfc19de1d9c707fc039
parent4430f862c8b28421bd23b633548fb8581954d105 (diff)
downloadlinux-linaro-696e47632a829950a7a41b1d36b672a1da571fdf.tar.gz
regulator: Checking return value of of_get_regulator_init_data
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>
-rw-r--r--drivers/regulator/fixed.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index db90919f99c..2997f11af90 100644
--- 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;