Skip to content

Commit 06dd759

Browse files
Dan CarpenterIngo Molnar
authored andcommitted
x86/module: Remove unnecessary check in module_finalize()
The "calls" pointer can no longer be NULL after the following commit: ab9fea5 ("x86/alternative: Simplify callthunk patching") Delete this unnecessary check. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c305a4e commit 06dd759

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/kernel/module.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,8 @@ int module_finalize(const Elf_Ehdr *hdr,
278278
if (calls) {
279279
struct callthunk_sites cs = {};
280280

281-
if (calls) {
282-
cs.call_start = (void *)calls->sh_addr;
283-
cs.call_end = (void *)calls->sh_addr + calls->sh_size;
284-
}
281+
cs.call_start = (void *)calls->sh_addr;
282+
cs.call_end = (void *)calls->sh_addr + calls->sh_size;
285283

286284
callthunks_patch_module_calls(&cs, me);
287285
}

0 commit comments

Comments
 (0)