2010-02-11 19:20:55

by Mark Brown

[permalink] [raw]
Subject: [PATCH 2.6.33] 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 <[email protected]>
Cc: [email protected]
---

Not super critical for 2.6.33 but at least worth considering.

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 0bbf8e2..ce877e8 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -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;

--
1.6.6.1


2010-02-12 11:23:28

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH 2.6.33] regulator: Fix display of null constraints for regulators

On Thu, 2010-02-11 at 19:20 +0000, Mark Brown wrote:
> 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 <[email protected]>
> Cc: [email protected]
> ---
>

Applied.

> 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

--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk