From: Akinobu Mita Date: Wed, 17 Oct 2007 06:30:27 +0000 (-0700) Subject: module: return error when mod_sysfs_init() failed X-Git-Tag: v2.6.24-rc1~585 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d58ae67813ff97030d2f47ff7d1e5f54e5d7c5b3;p=linux-2.6-omap-h63xx.git 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 Acked-by: Rusty Russell Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/module.c b/kernel/module.c index c24c3c35405..a389b423c27 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 */