diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2015-01-19 17:37:04 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-01-19 20:08:32 -0500 |
commit | d453cded05ee219b77815ea194dc36efa5398bca (patch) | |
tree | 9f38c5ed55b653803eabecce959320d734606029 /arch/ia64 | |
parent | c772be52319de9756fd82f36d37a6d3e003441e3 (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 <rusty@rustcorp.com.au>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-ia64@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/module.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 24603be24c14..29754aae5177 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -305,14 +305,12 @@ plt_target (struct plt_entry *plt) | |||
305 | #endif /* !USE_BRL */ | 305 | #endif /* !USE_BRL */ |
306 | 306 | ||
307 | void | 307 | void |
308 | module_free (struct module *mod, void *module_region) | 308 | module_arch_freeing_init (struct module *mod) |
309 | { | 309 | { |
310 | if (mod && mod->arch.init_unw_table && | 310 | if (mod->arch.init_unw_table) { |
311 | module_region == mod->module_init) { | ||
312 | unw_remove_unwind_table(mod->arch.init_unw_table); | 311 | unw_remove_unwind_table(mod->arch.init_unw_table); |
313 | mod->arch.init_unw_table = NULL; | 312 | mod->arch.init_unw_table = NULL; |
314 | } | 313 | } |
315 | vfree(module_region); | ||
316 | } | 314 | } |
317 | 315 | ||
318 | /* Have we already seen one of these relocations? */ | 316 | /* Have we already seen one of these relocations? */ |