summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuyuki Kobayashi <koba@kmckk.co.jp>2012-06-28 23:36:21 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:36 +0200
commitfa042186b932e9b9ee9a2fd8a04a3acf7c70d224 (patch)
tree4dd747a1f03588e3a09e2281a49a5b25a4bc2c2e
parent816e3921480d216c415a7c27ac4e0bf62004db1d (diff)
downloadu-boot-imx-fa042186b932e9b9ee9a2fd8a04a3acf7c70d224.zip
u-boot-imx-fa042186b932e9b9ee9a2fd8a04a3acf7c70d224.tar.gz
u-boot-imx-fa042186b932e9b9ee9a2fd8a04a3acf7c70d224.tar.bz2
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.c8
1 files changed, 7 insertions, 1 deletions
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 <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)