From 923d48e48033b37ef77323d2cd48771d68160c96 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Wed, 21 Feb 2024 13:41:45 +0100 Subject: [PATCH] s390/boot: do not check for zero-termination relocation entry The relocation table is not expected to contain a zero-termination entry. The existing check is likely a left-over from similar x86 code that uses zero-entries as delimiters. s390 does not have ones and therefore the check could be avoided. Suggested-by: Ilya Leoshkevich Acked-by: Sumanth Korikkar Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens --- arch/s390/boot/startup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index d6709fd80fef..c09797ac820f 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -200,9 +200,7 @@ static void kaslr_adjust_relocs(unsigned long min_addr, unsigned long max_addr, long loc; /* Adjust R_390_64 relocations */ - for (reloc = vmlinux_relocs_64_start; - reloc < vmlinux_relocs_64_end && *reloc; - reloc++) { + for (reloc = vmlinux_relocs_64_start; reloc < vmlinux_relocs_64_end; reloc++) { loc = (long)*reloc + offset; if (loc < min_addr || loc > max_addr) error("64-bit relocation outside of kernel!\n");