Commit d58ae678 authored by Akinobu Mita's avatar Akinobu Mita Committed by 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: default avatarGreg Kroah-Hartman <>
Acked-by: default avatarRusty Russell <>
Signed-off-by: default avatarAkinobu Mita <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 22d2b35b
......@@ -1881,7 +1881,8 @@ static struct module *load_module(void __user *umod,
/* 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment