summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 19:24:26 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 19:24:26 +0200
commit50edb5cc22c7b2ea7df095913596e5a649bd6b41 (patch)
tree7d17ab844b3e91dabc0ea862d7c94624e25e8bd6 /kernel/module.c
parentMAINTAINERS: Become the docs maintainer (diff)
parentmodules, lock around setting of MODULE_STATE_UNFORMED (diff)
downloadlinux-50edb5cc22c7b2ea7df095913596e5a649bd6b41.tar.xz
linux-50edb5cc22c7b2ea7df095913596e5a649bd6b41.zip
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module fix from Rusty Russell: "A single panic fix for a rare race, stable CC'd" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: modules, lock around setting of MODULE_STATE_UNFORMED
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 65586ffa0c98..88cec1ddb1e3 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1842,7 +1842,9 @@ static void free_module(struct module *mod)
/* We leave it in list to prevent duplicate loads, but make sure
* that noone uses it while it's being deconstructed. */
+ mutex_lock(&module_mutex);
mod->state = MODULE_STATE_UNFORMED;
+ mutex_unlock(&module_mutex);
/* Remove dynamic debug info */
ddebug_remove_module(mod->name);