From: Dan Carpenter Date: Wed, 19 Feb 2025 13:48:49 +0000 (+0300) Subject: x86/module: Remove unnecessary check in module_finalize() X-Git-Tag: v6.15-rc1~216^2~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06dd759b68eea200e488cafbcfd382208a940777;p=thirdparty%2Fkernel%2Flinux.git x86/module: Remove unnecessary check in module_finalize() The "calls" pointer can no longer be NULL after the following commit: ab9fea59487d ("x86/alternative: Simplify callthunk patching") Delete this unnecessary check. Signed-off-by: Dan Carpenter Signed-off-by: Ingo Molnar Acked-by: Song Liu Link: https://lore.kernel.org/r/fcbb2f57-0714-4139-b441-8817365c16a1@stanley.mountain --- diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index cb9d295e67cbf..615f74c4bd6c0 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -278,10 +278,8 @@ int module_finalize(const Elf_Ehdr *hdr, if (calls) { struct callthunk_sites cs = {}; - if (calls) { - cs.call_start = (void *)calls->sh_addr; - cs.call_end = (void *)calls->sh_addr + calls->sh_size; - } + cs.call_start = (void *)calls->sh_addr; + cs.call_end = (void *)calls->sh_addr + calls->sh_size; callthunks_patch_module_calls(&cs, me); }