From: Greg KH <gregkh@suse.de>
To: Akinobu Mita <akinobu.mita@gmail.com>,
linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] module: return error when mod_sysfs_init() failed
Date: Sat, 29 Sep 2007 07:56:46 -0700 [thread overview]
Message-ID: <20070929145646.GB3075@suse.de> (raw)
In-Reply-To: <20070929100653.GA4121@APFDCB5C>
On Sat, Sep 29, 2007 at 07:06:53PM +0900, Akinobu Mita wrote:
> 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;
I must be still asleep this morning, but I think this patch does the
exact same thing as the original code does, right? Otherwise, this
code would always be failing.
Or do I just need to go get my morning coffee to wake up and see the
problem here?
thanks,
greg k-h
next prev parent reply other threads:[~2007-09-29 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20070929145646.GB3075@suse.de \
--to=gregkh@suse.de \
--cc=akinobu.mita@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.