Преглед изворни кода

regulator: Fix display of null constraints for regulators

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>
Mark Brown пре 15 година
родитељ
комит
973e9a2795
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      drivers/regulator/core.c

+ 1 - 1
drivers/regulator/core.c

@@ -661,7 +661,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
 static void print_constraints(struct regulator_dev *rdev)
 static void print_constraints(struct regulator_dev *rdev)
 {
 {
 	struct regulation_constraints *constraints = rdev->constraints;
 	struct regulation_constraints *constraints = rdev->constraints;
-	char buf[80];
+	char buf[80] = "";
 	int count = 0;
 	int count = 0;
 	int ret;
 	int ret;