public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: [PATCH] module: return error when mod_sysfs_init() failed
Date: Sat, 29 Sep 2007 19:06:53 +0900	[thread overview]
Message-ID: <20070929100653.GA4121@APFDCB5C> (raw)

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 */

             reply	other threads:[~2007-09-29 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29 10:06 Akinobu Mita [this message]
2007-09-29 13:51 ` [PATCH] module: return error when mod_sysfs_init() failed Rusty Russell
2007-09-29 14:56 ` Greg KH
2007-09-29 15:37   ` Akinobu Mita
2007-09-29 17:17     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070929100653.GA4121@APFDCB5C \
    --to=akinobu.mita@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox