path: root/arch/avr32/kernel/module.c
diff options
authorRusty Russell <>2015-01-20 09:07:04 +1030
committerRusty Russell <>2015-01-20 11:38:32 +1030
commitd453cded05ee219b77815ea194dc36efa5398bca (patch)
tree9f38c5ed55b653803eabecce959320d734606029 /arch/avr32/kernel/module.c
parentc772be52319de9756fd82f36d37a6d3e003441e3 (diff)
module_arch_freeing_init(): new hook for archs before module->module_init freed.
Archs have been abusing module_free() to clean up their arch-specific allocations. Since module_free() is also (ab)used by BPF and trace code, let's keep it to simple allocations, and provide a hook called before that. This means that avr32, ia64, parisc and s390 no longer need to implement their own module_free() at all. avr32 doesn't need module_finalize() either. Signed-off-by: Rusty Russell <> Cc: Chris Metcalf <> Cc: Haavard Skinnemoen <> Cc: Hans-Christian Egtvedt <> Cc: Tony Luck <> Cc: Fenghua Yu <> Cc: "James E.J. Bottomley" <> Cc: Helge Deller <> Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: Cc: Cc: Cc:
Diffstat (limited to 'arch/avr32/kernel/module.c')
1 files changed, 1 insertions, 12 deletions
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c
index 2c94129..164efa0 100644
--- a/arch/avr32/kernel/module.c
+++ b/arch/avr32/kernel/module.c
@@ -19,12 +19,10 @@
#include <linux/moduleloader.h>
#include <linux/vmalloc.h>
-void module_free(struct module *mod, void *module_region)
+void module_arch_freeing_init(struct module *mod)
mod->arch.syminfo = NULL;
- vfree(module_region);
static inline int check_rela(Elf32_Rela *rela, struct module *module,
@@ -291,12 +289,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
return ret;
-int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
- struct module *module)
- vfree(module->arch.syminfo);
- module->arch.syminfo = NULL;
- return 0;