Skip to content

Commit 4268b4d

Browse files
nivedita76ingomolnar
authored andcommitted
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
1 parent eb38be6 commit 4268b4d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

arch/x86/boot/compressed/kaslr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,9 @@ static unsigned long find_random_phys_addr(unsigned long minimum,
813813
return 0;
814814
}
815815

816-
if (process_efi_entries(minimum, image_size))
817-
return slots_fetch_random();
816+
if (!process_efi_entries(minimum, image_size))
817+
process_e820_entries(minimum, image_size);
818818

819-
process_e820_entries(minimum, image_size);
820819
return slots_fetch_random();
821820
}
822821

0 commit comments

Comments
 (0)