Message ID | 20241108-modules-ro_after_init-v3-3-6dd041b588a5@samsung.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | module: refactor ro_after_init failure path | expand |
Context | Check | Description |
---|---|---|
mcgrof/vmtest-modules-next-VM_Test-0 | fail | Logs for Run CI tests |
mcgrof/vmtest-modules-next-VM_Test-1 | fail | Logs for Run CI tests |
mcgrof/vmtest-modules-next-VM_Test-4 | success | Logs for setup / Setup kdevops environment |
mcgrof/vmtest-modules-next-VM_Test-5 | success | Logs for setup / Setup kdevops environment |
mcgrof/vmtest-modules-next-PR | fail | PR summary |
mcgrof/vmtest-modules-next-VM_Test-3 | success | Logs for cleanup / Archive results and cleanup |
mcgrof/vmtest-modules-next-VM_Test-2 | success | Logs for cleanup / Archive results and cleanup |
diff --git a/kernel/module/main.c b/kernel/module/main.c index 35a50ded64a6..2b45a6efa0a9 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2994,10 +2994,12 @@ static noinline int do_init_module(struct module *mod) fail_free_freeinit: kfree(freeinit); fail: + mutex_lock(&module_mutex); /* Try to protect us from buggy refcounters. */ mod->state = MODULE_STATE_GOING; - synchronize_rcu(); module_put(mod); + mutex_unlock(&module_mutex); + synchronize_rcu(); blocking_notifier_call_chain(&module_notify_list, MODULE_STATE_GOING, mod); klp_module_going(mod);