[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070904085331.GH5944@hindley.org.uk>
Date: Tue, 4 Sep 2007 09:53:31 +0100
From: Mark Hindley <mark@...dley.org.uk>
To: Satyam Sharma <satyam@...radead.org>
Cc: Steffen Klassert <klassert@...hematik.tu-chemnitz.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Netdev Mailing List <netdev@...r.kernel.org>,
Jeff Garzik <jeff@...zik.org>
Subject: Re: [PATCH -mm 1/2] 3c59x: Fix uninitialized variable bug
On Tue, Sep 04, 2007 at 02:09:47PM +0530, Satyam Sharma wrote:
> Hi Steffen,
>
>
> On Tue, 4 Sep 2007, Steffen Klassert wrote:
>
> > On Tue, Sep 04, 2007 at 03:45:55AM +0530, Satyam Sharma wrote:
> > >
> > > drivers/net/3c59x.c: In function 'vortex_up':
> > > drivers/net/3c59x.c:1495: warning: 'err' may be used uninitialized in this function
> >
> > This came in with the recently applied 3c59x-check-return-of-pci_enable_device patch
> > from Mark Hindley. I just compiled it on a PCI only machine so far, therefore I did
> > not notice the warning yet.
>
> Hmm, the .config I built with had PCI=y as well. Probably a compiler
> version difference -- Jeff also mentioned yesterday that some newer
> GCC versions fail to warn about uninitialized variables cases.
>
Sorry, this is my bad. I have just checked: there is no warning with gcc
4.2 or 4.1, but 3.3 emits the warning.
>
> > > is a genuine bug. The function returns an uninitialized value of 'err'
> > > back to the caller, which expects it to be 0 for success cases. Let's
> > > fix this by explicitly initializing 'err' to zero.
> > >
> > > Signed-off-by: Satyam Sharma <satyam@...radead.org>
> > Acked-by: Steffen Klassert <klassert@...hematik.tu-chemnitz.de>
Acked-by: Mark Hindley <mark@...dley.org.uk>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists