]> git.sur5r.net Git - u-boot/commitdiff
arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
authorTetsuyuki Kobayashi <koba@kmckk.co.jp>
Thu, 28 Jun 2012 23:36:21 +0000 (23:36 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:36 +0000 (14:07 +0200)
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>
arch/arm/cpu/armv7/cpu.c

index c6fa8ef13617636a8c879cccbae626bf6ee8c2e1..9eb484af183644cb0831447a42707d8cc6b5409e 100644 (file)
 #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)