diff options
author | Marc Zyngier <Marc.Zyngier@arm.com> | 2012-04-11 13:52:56 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-13 13:05:41 (GMT) |
commit | a106b21a352517b57af1c3581e15b8787ffe4e98 (patch) | |
tree | 962c95d10f0aa152820a5ca9f6ac8269dbea21aa /arch/arm | |
parent | 9c5fd9e85f574d9d0361b2b878f55732290afe5b (diff) | |
download | linux-fsl-qoriq-a106b21a352517b57af1c3581e15b8787ffe4e98.tar.xz |
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')
-rw-r--r-- | arch/arm/boot/compressed/atags_to_fdt.c | 2 |
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 6ce11c4..797f04b 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) { |