Re: [PATCH] hostap: avoid uninitialized variable use in hfa384x_get_rid

2016-01-28 Thread Arnd Bergmann
On Wednesday 27 January 2016 19:26:13 Russell King - ARM Linux wrote: > On Wed, Jan 27, 2016 at 02:45:26PM +0100, Arnd Bergmann wrote: > So, why give the compiler a hard time as you're doing, why make the code > harder to read. What's wrong with: > > spin_lock_bh(&local->baplock); > >

Re: [PATCH] hostap: avoid uninitialized variable use in hfa384x_get_rid

2016-01-27 Thread Russell King - ARM Linux
On Wed, Jan 27, 2016 at 02:45:26PM +0100, Arnd Bergmann wrote: > To ensure we get consistent error handling here, this changes the code > to only set rlen if we actually read data correctly, which also takes > care of the warning. It may be a good idea to do the job better. Looking at the code:

[PATCH] hostap: avoid uninitialized variable use in hfa384x_get_rid

2016-01-27 Thread Arnd Bergmann
The driver reads a value from hfa384x_from_bap(), which may fail, and then assigns the value to a local variable. gcc detects that in in the failure case, the 'rlen' variable now contains uninitialized data: In file included from ../drivers/net/wireless/intersil/hostap/hostap_pci.c:220:0: drivers