Commit a106b21a authored by Marc Zyngier's avatar Marc Zyngier Committed by Russell King
Browse files

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: default avatarNicolas Pitre <>
Signed-off-by: default avatarMarc Zyngier <>
Signed-off-by: default avatarRussell King <>
parent 9c5fd9e8
......@@ -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)
if (!atag->u.mem.size)
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) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment