Skip to content
Snippets Groups Projects
Commit 95107b7c authored by Haavard Skinnemoen's avatar Haavard Skinnemoen
Browse files

avr32: Do stricter stack checking in the exception handler


Don't do a stack dump if the stack pointer is outside the memory area
reserved for stack.

Signed-off-by: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
parent caf83ea8
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,8 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs)
printf("CPU Mode: %s\n", cpu_modes[mode]);
/* Avoid exception loops */
if (regs->sp < CFG_SDRAM_BASE || regs->sp >= gd->stack_end)
if (regs->sp < (gd->stack_end - CONFIG_STACKSIZE)
|| regs->sp >= gd->stack_end)
printf("\nStack pointer seems bogus, won't do stack dump\n");
else
dump_mem("\nStack: ", regs->sp, gd->stack_end);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment