regulator: Check for constraints before using them for name

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Mark Brown 2009-08-03 18:49:54 +01:00 коммит произвёл Liam Girdwood
Родитель c53ad7fe57
Коммит b39480ac37
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -232,7 +232,7 @@ static ssize_t regulator_name_show(struct device *dev,
struct regulator_dev *rdev = dev_get_drvdata(dev);
const char *name;
if (rdev->constraints->name)
if (rdev->constraints && rdev->constraints->name)
name = rdev->constraints->name;
else if (rdev->desc->name)
name = rdev->desc->name;