diff options
author | Mark Rutland <mark.rutland@arm.com> | 2015-10-06 18:24:37 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-04-20 21:13:12 +0800 |
commit | ceaeeef160f9b477d006808363568c0b64f31e28 (patch) | |
tree | e0bb77be0efd2356efe360b183dd792fa08a48f6 | |
parent | 25a70e0d23117c7522640a006ec4730a8fd6055c (diff) |
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: 1570f0d7ab425c1e ("arm64: support initrd outside kernel linear map")
Cc: Mark Salter <msalter@redhat.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 4ca3bc86bea23f38596ce7508f75e072839bde44)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | arch/arm64/kernel/setup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 389959af1cf4..8ea977f954b3 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -394,6 +394,8 @@ static void __init relocate_initrd(void) to_free = ram_end - orig_start; size = orig_end - orig_start; + if (!size) + return; /* initrd needs to be relocated completely inside linear mapping */ new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn), |