aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-10-21 11:34:34 -0600
committerJohn Rigby <john.rigby@linaro.org>2011-11-14 19:48:19 -0700
commit68b0e603e0d446180ce18c8c873f389798df94f5 (patch)
tree4239aa51532e59cfe4d75a76d5b0a6af6e66ac15
parenta21c27c578ae50febf39870640b2183033b67a46 (diff)
OMAP4: avoid null pointer access in save_boot_params
When booting via spl the parameter layout is apparently different and this leads to following bad pointers. For now just work around the issue by checking pointers before following them. Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--arch/arm/cpu/armv7/omap4/lowlevel_init.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap4/lowlevel_init.S b/arch/arm/cpu/armv7/omap4/lowlevel_init.S
index 91525ecd4..144ef419b 100644
--- a/arch/arm/cpu/armv7/omap4/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap4/lowlevel_init.S
@@ -51,7 +51,13 @@ save_boot_params:
/* Store the boot mode (raw/FAT) in omap4_boot_mode */
ldr r2, [r0, #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr
+ bic r3, r2, #255
+ cmp r3, #0
+ beq 1f
ldr r2, [r2, #DEV_DATA_PTR_OFFSET] @ get the pDeviceData ptr
+ bic r3, r2, #255
+ cmp r3, #0
+ beq 1f
ldr r2, [r2, #BOOT_MODE_OFFSET] @ get the boot mode
ldr r3, =omap4_boot_mode
str r2, [r3]