summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-06-26 06:44:38 +0930
committerRusty Russell <rusty@rustcorp.com.au>2015-06-28 14:46:14 +0930
commitcf2fde7b39e9446e2af015215d7fb695781af0c1 (patch)
tree646bec4e1717bf8370a3d4153c59a06a4a78f73f /kernel/module.c
parent38183b9c31cf21d8996d6eee2e3a14508b20c418 (diff)
downloadlinux-cf2fde7b39e9446e2af015215d7fb695781af0c1.tar.bz2
param: fix module param locks when !CONFIG_SYSFS.
As Dan Streetman points out, the entire point of locking for is to stop sysfs accesses, so they're elided entirely in the !SYSFS case. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 8ec33ce202a6..b4994adf7187 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1820,6 +1820,10 @@ static void mod_sysfs_fini(struct module *mod)
mod_kobject_put(mod);
}
+static void init_param_lock(struct module *mod)
+{
+ mutex_init(&mod->param_lock);
+}
#else /* !CONFIG_SYSFS */
static int mod_sysfs_setup(struct module *mod,
@@ -1842,6 +1846,9 @@ static void del_usage_links(struct module *mod)
{
}
+static void init_param_lock(struct module *mod)
+{
+}
#endif /* CONFIG_SYSFS */
static void mod_sysfs_teardown(struct module *mod)
@@ -3442,7 +3449,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
if (err)
goto unlink_mod;
- mutex_init(&mod->param_lock);
+ init_param_lock(mod);
/* Now we've got everything in the final locations, we can
* find optional sections. */