From 51d47999b9452a8dc7ae58a11423c5db28f21ae1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 4 Mar 2010 15:33:16 +0100 Subject: [PATCH] ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted If PC points outside kernel text, start printing the backtrace at LR instead. Signed-off-by: Laurent Pinchart Signed-off-by: Russell King --- arch/arm/kernel/unwind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 786ac2b6914..50292cd9c12 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -359,7 +359,9 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk) frame.fp = regs->ARM_fp; frame.sp = regs->ARM_sp; frame.lr = regs->ARM_lr; - frame.pc = regs->ARM_pc; + /* PC might be corrupted, use LR in that case. */ + frame.pc = kernel_text_address(regs->ARM_pc) + ? regs->ARM_pc : regs->ARM_lr; } else if (tsk == current) { frame.fp = (unsigned long)__builtin_frame_address(0); frame.sp = current_sp; -- 2.39.5