regulator: Fix display of null constraints for regulators

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, February 12, 2010 - 9:59 am

Gitweb:     http://git.kernel.org/linus/973e9a2795b3b41d8408a0bb6f87b783c5efc88a
Commit:     973e9a2795b3b41d8408a0bb6f87b783c5efc88a
Parent:     676ad585531e965416fd958747894541dabcec96
Author:     Mark Brown <broonie@opensource.wolfsonmicro.com>
AuthorDate: Thu Feb 11 19:20:48 2010 +0000
Committer:  Liam Girdwood <lrg@slimlogic.co.uk>
CommitDate: Fri Feb 12 11:19:57 2010 +0000

    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>
---
 drivers/regulator/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 686ef27..b60a4c9 100644
--- a/drivers/regulator/core.c
+++ b/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)
 {
 	struct regulation_constraints *constraints = rdev->constraints;
-	char buf[80];
+	char buf[80] = "";
 	int count = 0;
 	int ret;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
regulator: Fix display of null constraints for regulators, Linux Kernel Mailing ..., (Fri Feb 12, 9:59 am)