diff options
author | Marc Zyngier <Marc.Zyngier@arm.com> | 2012-04-11 09:52:56 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-13 09:05:41 -0400 |
commit | a106b21a352517b57af1c3581e15b8787ffe4e98 (patch) | |
tree | 962c95d10f0aa152820a5ca9f6ac8269dbea21aa | |
parent | 9c5fd9e85f574d9d0361b2b878f55732290afe5b (diff) |
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>
-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 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) | |||
77 | } else if (atag->hdr.tag == ATAG_MEM) { | 77 | } else if (atag->hdr.tag == ATAG_MEM) { |
78 | if (memcount >= sizeof(mem_reg_property)/4) | 78 | if (memcount >= sizeof(mem_reg_property)/4) |
79 | continue; | 79 | continue; |
80 | if (!atag->u.mem.size) | ||
81 | continue; | ||
80 | mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start); | 82 | mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start); |
81 | mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size); | 83 | mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size); |
82 | } else if (atag->hdr.tag == ATAG_INITRD2) { | 84 | } else if (atag->hdr.tag == ATAG_INITRD2) { |