mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
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: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
This commit is contained in:
parent
caf83ea888
commit
95107b7c02
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue