diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-11-17 17:09:52 +0300 |
|---|---|---|
| committer | Heiko Carstens <hca@linux.ibm.com> | 2025-11-24 13:45:21 +0300 |
| commit | 1d7764cfe33626f8487febbcb2ad2acc9bd14c2c (patch) | |
| tree | 5d72fb8c2d2236c9fea3556ade2a99d82b29df1b | |
| parent | c3d17464f0262c9e3c156d4c6306e32cf530fa47 (diff) | |
| download | linux-1d7764cfe33626f8487febbcb2ad2acc9bd14c2c.tar.xz | |
s390/modules: Simplify module_finalize() slightly
Preinitialize the return value, and break out the for loop in
module_finalize() in case of an error to get rid of an ifdef.
This makes it easier to add additional code, which may also depend
on config options.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
| -rw-r--r-- | arch/s390/kernel/module.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 91e207b50394..54d99e811a83 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c @@ -495,9 +495,7 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *s; char *secstrings, *secname; void *aseg; -#ifdef CONFIG_FUNCTION_TRACER - int ret; -#endif + int rc = 0; if (IS_ENABLED(CONFIG_EXPOLINE) && !nospec_disable && me->arch.plt_size) { @@ -529,12 +527,12 @@ int module_finalize(const Elf_Ehdr *hdr, #ifdef CONFIG_FUNCTION_TRACER if (!strcmp(FTRACE_CALLSITE_SECTION, secname)) { - ret = module_alloc_ftrace_hotpatch_trampolines(me, s); - if (ret < 0) - return ret; + rc = module_alloc_ftrace_hotpatch_trampolines(me, s); + if (rc) + break; } #endif /* CONFIG_FUNCTION_TRACER */ } - return 0; + return rc; } |
