public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: return error when mod_sysfs_init() failed
@ 2007-09-29 10:06 Akinobu Mita
  2007-09-29 13:51 ` Rusty Russell
  2007-09-29 14:56 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Akinobu Mita @ 2007-09-29 10:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Rusty Russell

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.

Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: 2.6-git/kernel/module.c
===================================================================
--- 2.6-git.orig/kernel/module.c
+++ 2.6-git/kernel/module.c
@@ -1782,7 +1782,8 @@ static struct module *load_module(void _
 	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 */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-29 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-29 10:06 [PATCH] module: return error when mod_sysfs_init() failed Akinobu Mita
2007-09-29 13:51 ` Rusty Russell
2007-09-29 14:56 ` Greg KH
2007-09-29 15:37   ` Akinobu Mita
2007-09-29 17:17     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox