Skip to contentSkip to conversation

regulator: Fix display of null constraints for regulators

PATCH Applied Mark Brown 2 participants 2 messages Feb 11, 2010 – Feb 12, 2010

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---

Not super critical for 2.6.33 but at least worth considering.

 drivers/regulator/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/core.c +1 -1
index 0bbf8e2..ce877e8 100644
@@ -664,7 +664,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;
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 10 lines · Mark Brown

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.

---

Applied.

Quoted 1 line

Not super critical for 2.6.33 but at least worth considering.

Agreed, I will issue pull request for this for 2.6.33.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk