diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-06-10 19:43:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-06-10 19:43:21 -0400 |
commit | 8f4b8c7613928d5c6da43715fedc00a7b1ee53be (patch) | |
tree | 10ea6f43945712e725268f2b025d56e6005b4808 /arch | |
parent | 099b4d3b473db012a55ce6bec9ef594d0508e782 (diff) |
ARM: initrd: disable initrds outside of memory
We can't cope with initrds outside of memory, so check that the
initrd is within some declared memory to the kernel before using
it. Otherwise we're likely to OOPS during boot.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mm/init.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index b2cf9460ea60..c19571c40a21 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -331,6 +331,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) | |||
331 | #endif | 331 | #endif |
332 | #ifdef CONFIG_BLK_DEV_INITRD | 332 | #ifdef CONFIG_BLK_DEV_INITRD |
333 | if (phys_initrd_size && | 333 | if (phys_initrd_size && |
334 | !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) { | ||
335 | pr_err("INITRD: 0x%08lx+0x%08lx is not a memory region - disabling initrd\n", | ||
336 | phys_initrd_start, phys_initrd_size); | ||
337 | phys_initrd_start = phys_initrd_size = 0; | ||
338 | } | ||
339 | if (phys_initrd_size && | ||
334 | memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) { | 340 | memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) { |
335 | pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n", | 341 | pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n", |
336 | phys_initrd_start, phys_initrd_size); | 342 | phys_initrd_start, phys_initrd_size); |