提交 d58ae678 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

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: NGreg Kroah-Hartman <gregkh@suse.de>
Acked-by: NRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 22d2b35b
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册