Patchwork [03/37] powerpc/kdump64: Don't reference freed memory as pacas

login
register
mail settings
Submitter Milton Miller
Date May 11, 2011, 5:28 a.m.
Message ID <a8b749a3d0ac4e4da123c6abe344d2283a1ee637.1305092637.git.miltonm@bga.com>
Download mbox | patch
Permalink /patch/95074/
State Accepted, archived
Commit bd9e5eefecb3d69018bb95796298019d309cbec8
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Milton Miller - May 11, 2011, 5:28 a.m.
Starting with 1426d5a3bd07589534286375998c0c8c6fdc5260 (powerpc:
Dynamically allocate pacas) the space for pacas beyond cpu_possible
is freed, but we failed to update the loop in crash.c.

Since c1854e00727f50f7ac99e98d26ece04c087ef785 (powerpc: Set nr_cpu_ids
early and use it to free PACAs) the number of pacas allocated is
always nr_cpu_ids.

Signed-off-by: Milton Miller <miltonm@bga.com>
Cc: <stable@kernel.org> # .34.x
---
This is the simplest fix, and quite sutiable for stable.

We can merge the crash waits with the normal kexec waits later,
and fix the hole described in the other version.
---
 arch/powerpc/kernel/crash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 21f2c78..4e6ee94 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -236,7 +236,7 @@  static void crash_kexec_wait_realmode(int cpu)
 	int i;
 
 	msecs = 10000;
-	for (i=0; i < NR_CPUS && msecs > 0; i++) {
+	for (i=0; i < nr_cpu_ids && msecs > 0; i++) {
 		if (i == cpu)
 			continue;