diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index d0b5f8db11b4..ccd641991842 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1537,6 +1537,7 @@ static int __unlink_module(void *_mod) | |||
1537 | { | 1537 | { |
1538 | struct module *mod = _mod; | 1538 | struct module *mod = _mod; |
1539 | list_del(&mod->list); | 1539 | list_del(&mod->list); |
1540 | module_bug_cleanup(mod); | ||
1540 | return 0; | 1541 | return 0; |
1541 | } | 1542 | } |
1542 | 1543 | ||
@@ -2625,6 +2626,7 @@ static struct module *load_module(void __user *umod, | |||
2625 | if (err < 0) | 2626 | if (err < 0) |
2626 | goto ddebug; | 2627 | goto ddebug; |
2627 | 2628 | ||
2629 | module_bug_finalize(info.hdr, info.sechdrs, mod); | ||
2628 | list_add_rcu(&mod->list, &modules); | 2630 | list_add_rcu(&mod->list, &modules); |
2629 | mutex_unlock(&module_mutex); | 2631 | mutex_unlock(&module_mutex); |
2630 | 2632 | ||
@@ -2650,6 +2652,8 @@ static struct module *load_module(void __user *umod, | |||
2650 | mutex_lock(&module_mutex); | 2652 | mutex_lock(&module_mutex); |
2651 | /* Unlink carefully: kallsyms could be walking list. */ | 2653 | /* Unlink carefully: kallsyms could be walking list. */ |
2652 | list_del_rcu(&mod->list); | 2654 | list_del_rcu(&mod->list); |
2655 | module_bug_cleanup(mod); | ||
2656 | |||
2653 | ddebug: | 2657 | ddebug: |
2654 | if (!mod->taints) | 2658 | if (!mod->taints) |
2655 | dynamic_debug_remove(info.debug); | 2659 | dynamic_debug_remove(info.debug); |