[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070929171722.GA18041@suse.de>
Date: Sat, 29 Sep 2007 10:17:22 -0700
From: Greg KH <gregkh@...e.de>
To: Akinobu Mita <akinobu.mita@...il.com>
Cc: linux-kernel@...r.kernel.org, Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH] module: return error when mod_sysfs_init() failed
On Sun, Sep 30, 2007 at 12:37:10AM +0900, Akinobu Mita wrote:
> 2007/9/29, Greg KH <gregkh@...e.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists