From c401643a23082829963c1f6a8057bca37ba60175 Mon Sep 17 00:00:00 2001 From: Hosung Kim Date: Thu, 21 Sep 2017 13:45:41 +0900 Subject: [PATCH] [COMMON] panic: NOT allowed re-entrance by same cpu if panic and then panic again on the same cpu, it is allowed re-entrance. In that situation, it is likely to happen panic again again. So this patch don't allow re-entrace of same cpu to prevent that situation. Change-Id: I766f4f72b589be675747f66bb2ec732c07f60b81 Signed-off-by: Hosung Kim --- kernel/panic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index 717e8be75ab8..1c56a8b8113a 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -165,9 +165,8 @@ void panic(const char *fmt, ...) this_cpu = raw_smp_processor_id(); old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, this_cpu); - if (old_cpu != PANIC_CPU_INVALID && old_cpu != this_cpu) { + if (old_cpu != PANIC_CPU_INVALID) panic_smp_self_stop(); - } console_verbose(); bust_spinlocks(1); -- 2.20.1