User: Password:
|
|
Subscribe / Log in / New account

[22/93] regulator: Fix display of null constraints for regulators

From:  Greg KH <gregkh-AT-suse.de>
To:  linux-kernel-AT-vger.kernel.org, stable-AT-kernel.org
Subject:  [22/93] regulator: Fix display of null constraints for regulators
Date:  Fri, 19 Feb 2010 08:29:15 -0800
Cc:  stable-review-AT-kernel.org, torvalds-AT-linux-foundation.org, akpm-AT-linux-foundation.org, alan-AT-lxorguk.ukuu.org.uk, Mark Brown <broonie-AT-opensource.wolfsonmicro.com>, Liam Girdwood <lrg-AT-slimlogic.co.uk>
Archive-link:  Article, Thread

2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -640,7 +640,7 @@ static int suspend_prepare(struct regula
 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) {




(Log in to post comments)


Copyright © 2010, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds