Files
linux/drivers/net
Arnd Bergmann 9a35bc2ae5 hostap: avoid uninitialized variable use in hfa384x_get_rid
commit 48dc5fb3ba upstream.

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/net/wireless/intersil/hostap/hostap_hw.c: In function 'hfa384x_get_rid':
drivers/net/wireless/intersil/hostap/hostap_hw.c:842:5: warning: 'rec' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (le16_to_cpu(rec.len) == 0) {

This restructures the function as suggested by Russell King, to
make it more readable and get more reliable error handling, by
handling each failure mode using a goto.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-30 05:49:28 +02:00
..
2016-09-30 10:18:36 +02:00
2015-08-13 21:12:17 -07:00
2015-11-15 17:09:23 -05:00
2015-11-17 14:39:29 -05:00
2015-10-21 19:36:10 -07:00
2015-07-08 16:00:09 -07:00
2015-10-13 04:55:07 -07:00
2017-02-18 16:39:27 +01:00
2016-04-12 09:08:58 -07:00
2017-02-18 16:39:27 +01:00
2017-03-22 12:04:16 +01:00