From: Arvind Sankar Date: Tue, 28 Jul 2020 22:57:18 +0000 (-0400) Subject: x86/kaslr: Small cleanup of find_random_phys_addr() X-Git-Tag: v5.10.7~1490^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4268b4da572f8bde8bc2f3243927ff5795687a6f;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-18-nivedita@alum.mit.edu --- diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index ce34a05..ecdf33d 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(); }