]> git.itanic.dy.fi Git - linux-stable/commitdiff
regulator: Fix display of null constraints for regulators
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 11 Feb 2010 19:20:48 +0000 (19:20 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:49 +0000 (07:37 -0800)
commit 973e9a2795b3b41d8408a0bb6f87b783c5efc88a upstream.

If the regulator constraints are empty and there is no voltage
reported then nothing will be added to the text displayed for the
constraints, leading to random stack data being printed. This is
unlikely to happen for practical regulators since most will at
least report a voltage but should still be fixed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/regulator/core.c

index efe568deda12b7710e882e07d81388af9053e484..1836053c919d29abd804b63b43a2766f16b4a32b 100644 (file)
@@ -640,7 +640,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
 static void print_constraints(struct regulator_dev *rdev)
 {
        struct regulation_constraints *constraints = rdev->constraints;
-       char buf[80];
+       char buf[80] = "";
        int count;
 
        if (rdev->desc->type == REGULATOR_VOLTAGE) {