Commit 881eb621 authored by Jie Zhang's avatar Jie Zhang Committed by Bryan Wu

Blackfin arch: Add one more check on `fp' to prevent double fault

Signed-off-by: default avatarJie Zhang <jie.zhang@analog.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 45c4f2a0
...@@ -820,11 +820,8 @@ void show_stack(struct task_struct *task, unsigned long *stack) ...@@ -820,11 +820,8 @@ void show_stack(struct task_struct *task, unsigned long *stack)
decode_address(buf, (unsigned int)stack); decode_address(buf, (unsigned int)stack);
printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf); printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf);
addr = (unsigned int *)((unsigned int)stack & ~0x3F);
/* First thing is to look for a frame pointer */ /* First thing is to look for a frame pointer */
for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0; for (addr = (unsigned int *)((unsigned int)stack & ~0xF); addr < endstack; addr++) {
addr < endstack; addr++, i++) {
if (*addr & 0x1) if (*addr & 0x1)
continue; continue;
ins_addr = (unsigned short *)*addr; ins_addr = (unsigned short *)*addr;
...@@ -834,7 +831,8 @@ void show_stack(struct task_struct *task, unsigned long *stack) ...@@ -834,7 +831,8 @@ void show_stack(struct task_struct *task, unsigned long *stack)
if (fp) { if (fp) {
/* Let's check to see if it is a frame pointer */ /* Let's check to see if it is a frame pointer */
while (fp >= (addr - 1) && fp < endstack && fp) while (fp >= (addr - 1) && fp < endstack
&& fp && ((unsigned int) fp & 0x3) == 0)
fp = (unsigned int *)*fp; fp = (unsigned int *)*fp;
if (fp == 0 || fp == endstack) { if (fp == 0 || fp == endstack) {
fp = addr - 1; fp = addr - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment