diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index a7b72a81d248..da90396788dd 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1591,14 +1591,14 @@ static void read_symbols(const char *modname) struct elf_info info = { }; Elf_Sym *sym; - if (!parse_elf(&info, modname)) - return; - if (!strends(modname, ".o")) { error("%s: filename must be suffixed with .o\n", modname); return; } + if (!parse_elf(&info, modname)) + return; + /* strip trailing .o */ mod = new_module(modname, strlen(modname) - strlen(".o"));