aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Tomlin <atomlin@redhat.com>2016-10-20 12:18:12 -0400
committerJessica Yu <jeyu@redhat.com>2016-11-26 14:18:02 -0500
commit885a78d4a5b3ad2d7c41d1819b001d7957f442cd (patch)
tree166dbe72b7c6f98c03098af203e808c25560edad
parentc714965f580accdb6715cb28285eeccea18dafdb (diff)
module: Ensure a module's state is set accordingly during module coming cleanup code
In load_module() in the event of an error, for e.g. unknown module parameter(s) specified we go to perform some module coming clean up operations. At this point the module is still in a "formed" state when it is actually going away. This patch updates the module's state accordingly to ensure anyone on the module_notify_list waiting for a module going away notification will be notified accordingly. Signed-off-by: Aaron Tomlin <atomlin@redhat.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: http://lkml.kernel.org/r/1476980293-19062-2-git-send-email-atomlin@redhat.com Signed-off-by: Jessica Yu <jeyu@redhat.com>
-rw-r--r--kernel/module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index a4acd8f403ae..f082832ad3ad 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3697,6 +3697,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
3697 sysfs_cleanup: 3697 sysfs_cleanup:
3698 mod_sysfs_teardown(mod); 3698 mod_sysfs_teardown(mod);
3699 coming_cleanup: 3699 coming_cleanup:
3700 mod->state = MODULE_STATE_GOING;
3700 blocking_notifier_call_chain(&module_notify_list, 3701 blocking_notifier_call_chain(&module_notify_list,
3701 MODULE_STATE_GOING, mod); 3702 MODULE_STATE_GOING, mod);
3702 klp_module_going(mod); 3703 klp_module_going(mod);