From 72e4f52a227776c9e5b328d63b098863e4871d9c Mon Sep 17 00:00:00 2001 From: John Rigby Date: Fri, 21 Oct 2011 11:34:34 -0600 Subject: 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 --- arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/cpu/armv7/omap-common/lowlevel_init.S') diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S index 35f38acf5..bc0e66a9a 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 @@ 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] -- cgit v1.2.3