diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-26 20:19:19 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2012-01-03 21:08:52 +0800 |
commit | 53b6355e236b1b99dfe8eb04ea53f4bbf8066432 (patch) | |
tree | 126c87a0ffdcbf97307575e3613c2a0e4bbe77e5 | |
parent | 6e02ad492bf803a576758226258338c2da79257e (diff) |
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.c | 3 |
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; |