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>
This commit is contained in:
Родитель
e69af5e967
Коммит
4b864af1a3
|
@ -64,6 +64,9 @@ struct fixed_voltage_config *of_get_fixed_voltage_config(struct device *dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
config->init_data = of_get_regulator_init_data(dev);
|
config->init_data = of_get_regulator_init_data(dev);
|
||||||
|
if (!config->init_data)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
init_data = config->init_data;
|
init_data = config->init_data;
|
||||||
|
|
||||||
config->supply_name = init_data->constraints.name;
|
config->supply_name = init_data->constraints.name;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче