aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r--arch/powerpc/boot/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 9e7f3ddd9913..ae32801ebd69 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -56,9 +56,19 @@ static struct addr_range prep_kernel(void)
56 if (platform_ops.vmlinux_alloc) { 56 if (platform_ops.vmlinux_alloc) {
57 addr = platform_ops.vmlinux_alloc(ei.memsize); 57 addr = platform_ops.vmlinux_alloc(ei.memsize);
58 } else { 58 } else {
59 if ((unsigned long)_start < ei.memsize) 59 /*
60 * Check if the kernel image (without bss) would overwrite the
61 * bootwrapper. The device tree has been moved in fdt_init()
62 * to an area allocated with malloc() (somewhere past _end).
63 */
64 if ((unsigned long)_start < ei.loadsize)
60 fatal("Insufficient memory for kernel at address 0!" 65 fatal("Insufficient memory for kernel at address 0!"
61 " (_start=%p)\n\r", _start); 66 " (_start=%p, uncomressed size=%08x)\n\r",
67 _start, ei.loadsize);
68
69 if ((unsigned long)_end < ei.memsize)
70 fatal("The final kernel image would overwrite the "
71 "device tree\n\r");
62 } 72 }
63 73
64 /* Finally, gunzip the kernel */ 74 /* Finally, gunzip the kernel */