diff options
author | Vincent Wen <vincentwenlinux@gmail.com> | 2012-07-19 03:11:16 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-07-19 05:23:44 -0400 |
commit | e909be825212da62433e805f03586015a04f3c78 (patch) | |
tree | 0f6671bda7cd9709bda9c83930271fa947a13132 | |
parent | ca760ca5238c55cd0e29291c63e35ac6634d385f (diff) |
MIPS: Fix Magic SysRq L kernel crash.
show_backtrace() was passed a NULL pointer which caused paging
request fail. Set to current task as other architectures (ARM,
etc) do when passed a NULL task pointer.
Signed-off-by: Vincent Wen <vincentwenlinux@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/3524/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/traps.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index ce95f2c41f3f..9716f057a77b 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -132,6 +132,9 @@ static void show_backtrace(struct task_struct *task, const struct pt_regs *regs) | |||
132 | unsigned long ra = regs->regs[31]; | 132 | unsigned long ra = regs->regs[31]; |
133 | unsigned long pc = regs->cp0_epc; | 133 | unsigned long pc = regs->cp0_epc; |
134 | 134 | ||
135 | if (!task) | ||
136 | task = current; | ||
137 | |||
135 | if (raw_show_trace || !__kernel_text_address(pc)) { | 138 | if (raw_show_trace || !__kernel_text_address(pc)) { |
136 | show_raw_backtrace(sp); | 139 | show_raw_backtrace(sp); |
137 | return; | 140 | return; |