From: Tetsuyuki Kobayashi Date: Thu, 28 Jun 2012 23:36:21 +0000 (+0000) Subject: arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0 X-Git-Tag: v2012.07-rc1~11^2~67 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fa042186b932e9b9ee9a2fd8a04a3acf7c70d224;p=u-boot arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0 save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashi Acked-by: Tom Rini --- diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef136..9eb484af18 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,15 @@ #include #include #include +#include -void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) +void __naked save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) { + /* + * Stack pointer is not yet initialized + * Don't save anything to stack even if compiled with -O0 + */ + asm("bx lr"); } void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)