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)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 12 Feb 2010 11:19:57 +0000 (11:19 +0000)
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>
Cc: stable@kernel.org
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/core.c

index 686ef270ecf7f01d23bf84a85b5f512be4566f10..b60a4c9f8f1680153e7c66c9c6fb5c72ec022dac 100644 (file)
@@ -661,7 +661,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 = 0;
        int ret;