diff options
author | Jie Zhang <jie.zhang@analog.com> | 2009-02-04 03:49:45 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-02-04 03:49:45 -0500 |
commit | 881eb621fc191e58fa638c533073683be2b63c24 (patch) | |
tree | f7e7d4bc6695d88cd09377468cc1e142d3047b31 /arch/blackfin/kernel/traps.c | |
parent | 45c4f2a0b6c6302c5617534b8189c0e9b5a4a048 (diff) |
Blackfin arch: Add one more check on `fp' to prevent double fault
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/traps.c')
-rw-r--r-- | arch/blackfin/kernel/traps.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index f18c2481e9b7..79926413c0eb 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -820,11 +820,8 @@ void show_stack(struct task_struct *task, unsigned long *stack) | |||
820 | decode_address(buf, (unsigned int)stack); | 820 | decode_address(buf, (unsigned int)stack); |
821 | printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf); | 821 | printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf); |
822 | 822 | ||
823 | addr = (unsigned int *)((unsigned int)stack & ~0x3F); | ||
824 | |||
825 | /* First thing is to look for a frame pointer */ | 823 | /* First thing is to look for a frame pointer */ |
826 | for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0; | 824 | for (addr = (unsigned int *)((unsigned int)stack & ~0xF); addr < endstack; addr++) { |
827 | addr < endstack; addr++, i++) { | ||
828 | if (*addr & 0x1) | 825 | if (*addr & 0x1) |
829 | continue; | 826 | continue; |
830 | ins_addr = (unsigned short *)*addr; | 827 | ins_addr = (unsigned short *)*addr; |
@@ -834,7 +831,8 @@ void show_stack(struct task_struct *task, unsigned long *stack) | |||
834 | 831 | ||
835 | if (fp) { | 832 | if (fp) { |
836 | /* Let's check to see if it is a frame pointer */ | 833 | /* Let's check to see if it is a frame pointer */ |
837 | while (fp >= (addr - 1) && fp < endstack && fp) | 834 | while (fp >= (addr - 1) && fp < endstack |
835 | && fp && ((unsigned int) fp & 0x3) == 0) | ||
838 | fp = (unsigned int *)*fp; | 836 | fp = (unsigned int *)*fp; |
839 | if (fp == 0 || fp == endstack) { | 837 | if (fp == 0 || fp == endstack) { |
840 | fp = addr - 1; | 838 | fp = addr - 1; |