aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 3965511ae133..68be0b1f9e7f 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1804,6 +1804,10 @@ void __weak module_arch_cleanup(struct module *mod)
1804{ 1804{
1805} 1805}
1806 1806
1807void __weak module_arch_freeing_init(struct module *mod)
1808{
1809}
1810
1807/* Free a module, remove from lists, etc. */ 1811/* Free a module, remove from lists, etc. */
1808static void free_module(struct module *mod) 1812static void free_module(struct module *mod)
1809{ 1813{
@@ -1841,6 +1845,7 @@ static void free_module(struct module *mod)
1841 1845
1842 /* This may be NULL, but that's OK */ 1846 /* This may be NULL, but that's OK */
1843 unset_module_init_ro_nx(mod); 1847 unset_module_init_ro_nx(mod);
1848 module_arch_freeing_init(mod);
1844 module_free(mod, mod->module_init); 1849 module_free(mod, mod->module_init);
1845 kfree(mod->args); 1850 kfree(mod->args);
1846 percpu_modfree(mod); 1851 percpu_modfree(mod);
@@ -2930,6 +2935,7 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
2930static void module_deallocate(struct module *mod, struct load_info *info) 2935static void module_deallocate(struct module *mod, struct load_info *info)
2931{ 2936{
2932 percpu_modfree(mod); 2937 percpu_modfree(mod);
2938 module_arch_freeing_init(mod);
2933 module_free(mod, mod->module_init); 2939 module_free(mod, mod->module_init);
2934 module_free(mod, mod->module_core); 2940 module_free(mod, mod->module_core);
2935} 2941}
@@ -3055,6 +3061,7 @@ static int do_init_module(struct module *mod)
3055 mod->strtab = mod->core_strtab; 3061 mod->strtab = mod->core_strtab;
3056#endif 3062#endif
3057 unset_module_init_ro_nx(mod); 3063 unset_module_init_ro_nx(mod);
3064 module_arch_freeing_init(mod);
3058 module_free(mod, mod->module_init); 3065 module_free(mod, mod->module_init);
3059 mod->module_init = NULL; 3066 mod->module_init = NULL;
3060 mod->init_size = 0; 3067 mod->init_size = 0;