aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss Dill <Russ.Dill@ti.com>2013-02-14 07:46:33 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-14 11:18:39 -0500
commit9c7b4e8a8ad2624106fbf690fa97ab9c8c9bfa88 (patch)
tree12b048ef63e04fcf5a3ba4b7f44424f7957ee792
parentf2e5d078f7f02d4289db31f5f63e23e39914075e (diff)
regulator: Fix memory garbage dev_err printout.
commit dd8004af: 'regulator: core: Log when a device causes a voltage constraint fail', tried to print out some information about the check consumer min/max uV fixup, however, it uses a garbage pointer left over from list_for_each_entry leading to boot messages in the form: '[ 2.079890] <RANDOM ASCII>: Restricting voltage, 3735899821-4294967295uV' Because it references regulator->dev, it could potentially read memory from anywhere causing a panic. This patch instead uses rdev and the updated min/max uV values. Signed-off-by: Russ Dill <Russ.Dill@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index abd3a05e8ee2..8d5e491514ee 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -200,8 +200,8 @@ static int regulator_check_consumers(struct regulator_dev *rdev,
200 } 200 }
201 201
202 if (*min_uV > *max_uV) { 202 if (*min_uV > *max_uV) {
203 dev_err(regulator->dev, "Restricting voltage, %u-%uuV\n", 203 rdev_err(rdev, "Restricting voltage, %u-%uuV\n",
204 regulator->min_uV, regulator->max_uV); 204 *min_uV, *max_uV);
205 return -EINVAL; 205 return -EINVAL;
206 } 206 }
207 207