aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-11-26 07:19:19 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 06:29:21 -0500
commit4b864af1a370103148e34044670cd9913de5c1be (patch)
treeed51d565ff600bb6f56385f21a974b0d1b6abac4 /drivers/regulator
parente69af5e9677b1e5bf2a2432747ecd714aa537f2a (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>
Diffstat (limited to 'drivers/regulator')
-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 db90919f99c2..2997f11af905 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)
64 return NULL; 64 return NULL;
65 65
66 config->init_data = of_get_regulator_init_data(dev); 66 config->init_data = of_get_regulator_init_data(dev);
67 if (!config->init_data)
68 return NULL;
69
67 init_data = config->init_data; 70 init_data = config->init_data;
68 71
69 config->supply_name = init_data->constraints.name; 72 config->supply_name = init_data->constraints.name;