ARM: bootm: Fix free_mem calculation when initrd is given
When a initrd is given we calculate the next free memory position
as:
free_mem = PAGE_ALIGN(initrd_end);
This is wrong when initrd_end exactly falls on a page boundary.
In this case PAGE_ALIGN() does nothing and free_mem becomes
initrd_end and the following bootm_load_devicetree() and thus
booting fails with -ENOMEM.

Fix this by correctly advancing to the next free memory position.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 3c4cb21 commit 834f6bf5e5f1169065376ad1aeb6a6266e66ce5c
@Sascha Hauer Sascha Hauer authored on 18 Oct 2016
Showing 1 changed file
View
arch/arm/lib/bootm.c