Skip to content

Commit

Permalink
libkmod: Fail if ELF cannot be stripped
Browse files Browse the repository at this point in the history
Do not fall back to regular module operations.

Signed-off-by: Tobias Stoeckmann <[email protected]>
  • Loading branch information
stoeckmann committed Oct 11, 2024
1 parent d164697 commit 5f4473d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libkmod/libkmod-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,12 @@ static int do_init_module(struct kmod_module *mod, unsigned int flags, const cha

stripped = kmod_elf_strip(elf, flags);
if (stripped == NULL) {
INFO(mod->ctx, "Failed to strip version information: %s\n",
strerror(errno));
mem = kmod_elf_get_memory(elf);
} else {
mem = stripped;
err = -errno;
ERR(mod->ctx, "Failed to strip version information: %s\n",
strerror(-err));
return err;
}
mem = stripped;
} else {
err = kmod_file_load_contents(mod->file);
if (err)
Expand Down

0 comments on commit 5f4473d

Please sign in to comment.