1
0
Fork 0

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>
hifive-unleashed-5.1
Akinobu Mita 2007-10-16 23:30:27 -07:00 committed by Linus Torvalds
parent 22d2b35b20
commit d58ae67813
1 changed files with 2 additions and 1 deletions

View File

@ -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 */