Skip to content

Commit

Permalink
module: s390: keep mod_arch_specific for livepatch modules
Browse files Browse the repository at this point in the history
Livepatch needs to utilize the symbol information contained in the
mod_arch_specific struct in order to be able to call the s390
apply_relocate_add() function to apply relocations. Keep a reference to
syminfo if the module is a livepatch module. Remove the redundant vfree()
in module_finalize() since module_arch_freeing_init() (which also frees
those structures) is called in do_init_module(). If the module isn't a
livepatch module, we free the structures in module_arch_freeing_init() as
usual.

Signed-off-by: Jessica Yu <jeyu@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jessica Yu authored and Jiri Kosina committed Apr 1, 2016
1 parent 1ce15ef commit f31e096
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/s390/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ void *module_alloc(unsigned long size)

void module_arch_freeing_init(struct module *mod)
{
if (is_livepatch_module(mod) &&
mod->state == MODULE_STATE_LIVE)
return;

vfree(mod->arch.syminfo);
mod->arch.syminfo = NULL;
}
Expand Down Expand Up @@ -425,7 +429,5 @@ int module_finalize(const Elf_Ehdr *hdr,
struct module *me)
{
jump_label_apply_nops(me);
vfree(me->arch.syminfo);
me->arch.syminfo = NULL;
return 0;
}

0 comments on commit f31e096

Please sign in to comment.