Skip to content

Commit

Permalink
regulator: Check for constraints before using them for name
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Liam Girdwood <[email protected]>
  • Loading branch information
broonie authored and Liam Girdwood committed Sep 22, 2009
1 parent c53ad7f commit b39480a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b39480a

Please sign in to comment.