diff options
author | Tetsuyuki Kobayashi | 2012-06-28 23:36:21 +0000 |
---|---|---|
committer | Albert ARIBAUD | 2012-07-07 14:07:36 +0200 |
commit | fa042186b932e9b9ee9a2fd8a04a3acf7c70d224 (patch) | |
tree | 4dd747a1f03588e3a09e2281a49a5b25a4bc2c2e | |
parent | 816e3921480d216c415a7c27ac4e0bf62004db1d (diff) |
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 <koba@kmckk.co.jp>
Acked-by: Tom Rini <trini@ti.com>
-rw-r--r-- | arch/arm/cpu/armv7/cpu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef1361..9eb484af183 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,15 @@ #include <asm/system.h> #include <asm/cache.h> #include <asm/armv7.h> +#include <linux/compiler.h> -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) |