summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2007-10-17 08:30:27 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 17:43:01 +0200
commitd58ae67813ff97030d2f47ff7d1e5f54e5d7c5b3 (patch)
tree41d8e470d578636a0e5aeaed2d1e959e0c1a99c7 /kernel/module.c
parentF_DUPFD_CLOEXEC implementation (diff)
downloadlinux-d58ae67813ff97030d2f47ff7d1e5f54e5d7c5b3.tar.xz
linux-d58ae67813ff97030d2f47ff7d1e5f54e5d7c5b3.zip
module: return error when mod_sysfs_init() failed
load_module() returns zero when mod_sysfs_init() fails, then the module loading will succeed accidentally. This patch makes load_module() return error correctly in that case. Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index c24c3c35405a..a389b423c279 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1881,7 +1881,8 @@ static struct module *load_module(void __user *umod,
module_unload_init(mod);
/* Initialize kobject, so we can reference it. */
- if (mod_sysfs_init(mod) != 0)
+ err = mod_sysfs_init(mod);
+ if (err)
goto cleanup;
/* Set up license info based on the info section */