Skip to content

Commit 4ca3bc8

Browse files
mrutland-armwildea01
authored andcommitted
arm64: Don't relocate non-existent initrd
When booting a kernel without an initrd, the kernel reports that it moves -1 bytes worth, having gone through the motions with initrd_start equal to initrd_end: Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff] Prevent this by bailing out early when the initrd size is zero (i.e. we have no initrd), avoiding the confusing message and other associated work. Fixes: 1570f0d ("arm64: support initrd outside kernel linear map") Cc: Mark Salter <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent abffa6f commit 4ca3bc8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
364364
to_free = ram_end - orig_start;
365365

366366
size = orig_end - orig_start;
367+
if (!size)
368+
return;
367369

368370
/* initrd needs to be relocated completely inside linear mapping */
369371
new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),

0 commit comments

Comments
 (0)