aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/kaslr.c
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-07-28 18:57:18 -0400
committerIngo Molnar <mingo@kernel.org>2020-07-31 11:08:17 +0200
commit4268b4da572f8bde8bc2f3243927ff5795687a6f (patch)
tree5f161e212f407c84af65729408eb7f2957343fd9 /arch/x86/boot/compressed/kaslr.c
parentx86/kaslr: Drop unnecessary alignment in find_random_virt_addr() (diff)
downloadlinux-dev-4268b4da572f8bde8bc2f3243927ff5795687a6f.tar.xz
linux-dev-4268b4da572f8bde8bc2f3243927ff5795687a6f.zip
x86/kaslr: Small cleanup of find_random_phys_addr()
Just a trivial rearrangement to do all the processing together, and only have one call to slots_fetch_random() in the source. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200728225722.67457-18-nivedita@alum.mit.edu
Diffstat (limited to 'arch/x86/boot/compressed/kaslr.c')
-rw-r--r--arch/x86/boot/compressed/kaslr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index ce34a05ccdc4..ecdf33da2a97 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -813,10 +813,9 @@ static unsigned long find_random_phys_addr(unsigned long minimum,
return 0;
}
- if (process_efi_entries(minimum, image_size))
- return slots_fetch_random();
+ if (!process_efi_entries(minimum, image_size))
+ process_e820_entries(minimum, image_size);
- process_e820_entries(minimum, image_size);
return slots_fetch_random();
}