All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: 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 10:17:22 -0700	[thread overview]
Message-ID: <20070929171722.GA18041@suse.de> (raw)
In-Reply-To: <961aa3350709290837m2d9d6668gd68b7cb8ac11e4d4@mail.gmail.com>

On Sun, Sep 30, 2007 at 12:37:10AM +0900, Akinobu Mita wrote:
> 2007/9/29, Greg KH <gregkh@suse.de>:
> > > 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?
> 
> Hello,
> 
> In the original code, the "err" is zero before goto cleanup.
> This "err" will be the return value of load_module().

Ah, ok, that makes sense now, thanks.  It was the error not getting
returned, it was not the fact that we were incorrectly checking the
return value of mod_sysfs_init.

thanks for clearing this up.

greg k-h

      reply	other threads:[~2007-09-29 17:27 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
2007-09-29 15:37   ` Akinobu Mita
2007-09-29 17:17     ` Greg KH [this message]

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=20070929171722.GA18041@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.