Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d58ae678 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

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 <gregkh@suse.de>
Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 22d2b35b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1881,7 +1881,8 @@ static struct module *load_module(void __user *umod,
	module_unload_init(mod);
	module_unload_init(mod);


	/* Initialize kobject, so we can reference it. */
	/* Initialize kobject, so we can reference it. */
	if (mod_sysfs_init(mod) != 0)
	err = mod_sysfs_init(mod);
	if (err)
		goto cleanup;
		goto cleanup;


	/* Set up license info based on the info section */
	/* Set up license info based on the info section */