summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib32/bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib32/bootm.c')
-rw-r--r--arch/arm/lib32/bootm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c
index c33ecc2ad8..28a645a9d0 100644
--- a/arch/arm/lib32/bootm.c
+++ b/arch/arm/lib32/bootm.c
@@ -114,10 +114,11 @@ static int get_kernel_addresses(size_t image_size,
kaddr = mem_start + image_decomp_size;
/*
- * Make sure we do not place the image past the end of the
+ * Make sure we do not place the image outside of the
* available memory.
*/
- if (kaddr + image_size + spacing >= mem_end)
+ if (((kaddr + image_size + spacing) > mem_end) &&
+ ((mem_end - image_size - spacing) >= mem_start))
kaddr = mem_end - image_size - spacing;
*load_address = PAGE_ALIGN_DOWN(kaddr);
@@ -745,8 +746,8 @@ static struct binfmt_hook binfmt_barebox_hook = {
.exec = "bootm",
};
-BAREBOX_MAGICVAR_NAMED(global_bootm_boot_atag, global.bootm.boot_atag,
- "If true, ignore device tree and boot using ATAGs");
+BAREBOX_MAGICVAR(global.bootm.boot_atag,
+ "If true, ignore device tree and boot using ATAGs");
static int armlinux_register_image_handler(void)
{