summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-03-31 10:36:41 +0530
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 15:15:03 +0200
commit6e4c42b171583370ae6547cb716ea40783526029 (patch)
tree61c4659982f85899686612fcb06901ae6c5a00aa
parentb277f5d1c74b3a5458253f8f52cd983af18cefd4 (diff)
ux500: cpuidle_dbg: fix memory corruption
ux500_ci_dbg_log() corrupts memory because the sh->state is improperly initialized, and thus memory beyond the allocated sh->time buffer is modified for the first time after boot or a stats reset. Fix it. ST-Ericsson Linux next: - ST-Ericsson ID: ER330431 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ia1c0aa0f0d2eb211d92fe89372a844cf8d1880da Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19554 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/pm/cpuidle_dbg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/pm/cpuidle_dbg.c b/arch/arm/mach-ux500/pm/cpuidle_dbg.c
index 9de82a56b5a..4df36fc0ea7 100644
--- a/arch/arm/mach-ux500/pm/cpuidle_dbg.c
+++ b/arch/arm/mach-ux500/pm/cpuidle_dbg.c
@@ -311,7 +311,7 @@ static ssize_t stats_write(struct file *file,
for (i = 0; i <= cstates_len; i++)
sh->start = ktime_get();
- sh->state = CI_RUNNING;
+ sh->state = cstates_len; /* CI_RUNNING */
spin_unlock_irqrestore(&sh->lock, flags);
}
@@ -537,7 +537,7 @@ void ux500_ci_dbg_init(void)
spin_lock_init(&sh->lock);
/* Only first CPU used during boot */
if (cpu == 0)
- sh->state = CI_RUNNING;
+ sh->state = cstates_len; /* CI_RUNNING */
else
sh->state = CI_WFI;
sh->start = ktime_get();