From 5382dcdea4358295ff4eff96611e3042045189db Mon Sep 17 00:00:00 2001 From: HATAYAMA Daisuke Date: Mon, 12 Dec 2011 10:18:56 +0900 Subject: [PATCH] task, fix: active_set[NR_CPUS-1] could wrongly be chosen as panic task On the kernels without panic_threads-like symbols, tt->active_set[NR_CPUS-1] could wrongly be chosen as panic task. The position of initialization code is wrong, so move it in the appropreate position. --- task.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/task.c b/task.c index 98624ab..8b4b1bb 100755 --- a/task.c +++ b/task.c @@ -4689,10 +4689,6 @@ get_panic_context(void) ulong task; char *tp; - tt->panic_processor = -1; - task = NO_TASK; - tc = FIRST_CONTEXT(); - for (i = 0; i < NR_CPUS; i++) { if (!(task = tt->active_set[i])) continue; @@ -4716,6 +4712,10 @@ get_panic_context(void) if (tt->flags & PANIC_TASK_NOT_FOUND) goto use_task_0; + tt->panic_processor = -1; + task = NO_TASK; + tc = FIRST_CONTEXT(); + if (symbol_exists("panic_threads") && symbol_exists("panicmsg") && symbol_exists("panic_processor")) { -- 1.7.4.4