Blackfin: do not try displaying the end of the stack
authorSonic Zhang <sonic.zhang@analog.com>
Thu, 16 Jul 2009 10:36:35 +0000 (10:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Thu, 17 Sep 2009 01:31:50 +0000 (21:31 -0400)
The end of the stack may not be valid (and that could be OK), so do not
attempt to parse it.  If we do, we might use a bad pointer in kernel space
which makes things panic().

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/kernel/traps.c

index 519acca..18c6cd4 100644 (file)
@@ -911,7 +911,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
                frame_no = 0;
 
                for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
-                    addr <= endstack; addr++, i++) {
+                    addr < endstack; addr++, i++) {
 
                        ret_addr = 0;
                        if (!j && i % 8 == 0)