summaryrefslogtreecommitdiffstats
path: root/arch/arm/boot/compressed
diff options
context:
space:
mode:
authorMarc Zyngier <Marc.Zyngier@arm.com>2012-04-11 15:52:56 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-04-13 15:05:41 +0200
commita106b21a352517b57af1c3581e15b8787ffe4e98 (patch)
tree962c95d10f0aa152820a5ca9f6ac8269dbea21aa /arch/arm/boot/compressed
parentARM: 7379/1: DT: fix atags_to_fdt() second call site (diff)
downloadlinux-a106b21a352517b57af1c3581e15b8787ffe4e98.tar.xz
linux-a106b21a352517b57af1c3581e15b8787ffe4e98.zip
ARM: 7380/1: DT: do not add a zero-sized memory property
Some bootloaders are broken enough to expose an ATAG_MEM with a null size. Converting such tag to a memory node leads to an unbootable system. Skip over zero sized ATAG_MEM to avoid this situation. Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/boot/compressed')
-rw-r--r--arch/arm/boot/compressed/atags_to_fdt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c
index 6ce11c481178..797f04bedb47 100644
--- a/arch/arm/boot/compressed/atags_to_fdt.c
+++ b/arch/arm/boot/compressed/atags_to_fdt.c
@@ -77,6 +77,8 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space)
} else if (atag->hdr.tag == ATAG_MEM) {
if (memcount >= sizeof(mem_reg_property)/4)
continue;
+ if (!atag->u.mem.size)
+ continue;
mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start);
mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size);
} else if (atag->hdr.tag == ATAG_INITRD2) {