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>2012-08-16 10:04:46 -0600
commit99c0c6c6a8d859127a492e26c5cd09b0192ad97a (patch)
tree7897250aff80a669f15baa39d8f26a0abb43a5a2
parent2a6e51b9cc2a7ddccc0e5aeee3477073c4353e48 (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/omap-common/lowlevel_init.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
index ccc6bb6b8..0d2a60067 100644
--- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
@@ -65,7 +65,13 @@ ENTRY(save_boot_params)
bgt 2f
/* Store the boot mode (raw/FAT) in omap_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, =omap_bootmode
str r2, [r3]