[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7116@saturn3.aculab.com>
Date: Fri, 18 Jan 2013 10:07:20 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "David Miller" <davem@...emloft.net>, <jacmet@...site.dk>
Cc: <sque@...omium.org>, <netdev@...r.kernel.org>, <msb@...omium.org>
Subject: RE: [PATCH] net: usb: initialize tmp in dm9601.c to avoid warning
> > Sure, I just wondered as the code hasn't changed in 5+ years, and the
> > function that gets called is defined just above, so the compiler should
> > be able to figure it out.
>
> Nothing guarentees that a piece of memory passed into an external
> function has it's contents initialized completely by that function.
>
> The compiler can't see what usbnet_read_cmd() does with the memory
> behind the 'data' pointer argument. So it makes the only assumption
> it can make, which is that 'tmp' might be uninitialized.
Possibly the called function is being inlined, then the analysis
knows that some paths don't assign a value.
When it isn't inlined it assumes the value is always modified.
David
--
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