From fa042186b932e9b9ee9a2fd8a04a3acf7c70d224 Mon Sep 17 00:00:00 2001 From: Tetsuyuki Kobayashi Date: Thu, 28 Jun 2012 23:36:21 +0000 Subject: [PATCH] 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 --- arch/arm/cpu/armv7/cpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..9eb484a 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) -- 2.7.4