From 2be9177c72f68a557adecf16c0bc5d84a08bc3e4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 2 Apr 2013 13:53:55 -0700 Subject: [PATCH] 3.8-stable patches added patches: regulator-fix-memory-garbage-dev_err-printout.patch --- ...-fix-memory-garbage-dev_err-printout.patch | 44 +++++++++++++++++++ queue-3.8/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 queue-3.8/regulator-fix-memory-garbage-dev_err-printout.patch diff --git a/queue-3.8/regulator-fix-memory-garbage-dev_err-printout.patch b/queue-3.8/regulator-fix-memory-garbage-dev_err-printout.patch new file mode 100644 index 00000000000..07444a059f4 --- /dev/null +++ b/queue-3.8/regulator-fix-memory-garbage-dev_err-printout.patch @@ -0,0 +1,44 @@ +From 9c7b4e8a8ad2624106fbf690fa97ab9c8c9bfa88 Mon Sep 17 00:00:00 2001 +From: Russ Dill +Date: Thu, 14 Feb 2013 04:46:33 -0800 +Subject: regulator: Fix memory garbage dev_err printout. + +From: Russ Dill + +commit 9c7b4e8a8ad2624106fbf690fa97ab9c8c9bfa88 upstream. + +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] : 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 +Signed-off-by: Mark Brown +Cc: Jonghwan Choi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/regulator/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -200,8 +200,8 @@ static int regulator_check_consumers(str + } + + if (*min_uV > *max_uV) { +- dev_err(regulator->dev, "Restricting voltage, %u-%uuV\n", +- regulator->min_uV, regulator->max_uV); ++ rdev_err(rdev, "Restricting voltage, %u-%uuV\n", ++ *min_uV, *max_uV); + return -EINVAL; + } + diff --git a/queue-3.8/series b/queue-3.8/series index 4239bfd7180..3191afc8a5d 100644 --- a/queue-3.8/series +++ b/queue-3.8/series @@ -93,3 +93,4 @@ xen-events-avoid-race-with-raising-an-event-in-unmask_evtchn.patch tracing-prevent-buffer-overwrite-disabled-for-latency-tracers.patch efivars-explicitly-calculate-length-of-variablename.patch efivars-handle-duplicate-names-from-get_next_variable.patch +regulator-fix-memory-garbage-dev_err-printout.patch -- 2.47.3