Skip to content

Commit 5e8ed28

Browse files
mirabJessica Yu
authored andcommitted
module: set MODULE_STATE_GOING state when a module fails to load
If a module fails to load due to an error in prepare_coming_module(), the following error handling in load_module() runs with MODULE_STATE_COMING in module's state. Fix it by correctly setting MODULE_STATE_GOING under "bug_cleanup" label. Signed-off-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Jessica Yu <jeyu@kernel.org>
1 parent 3650b22 commit 5e8ed28

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎kernel/module.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3991,6 +3991,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
39913991
MODULE_STATE_GOING, mod);
39923992
klp_module_going(mod);
39933993
bug_cleanup:
3994+
mod->state = MODULE_STATE_GOING;
39943995
/* module_bug_cleanup needs module_mutex protection */
39953996
mutex_lock(&module_mutex);
39963997
module_bug_cleanup(mod);

0 commit comments

Comments
 (0)