android_kernel_oneplus_msm8998/drivers/net/wireless/hostap
Arnd Bergmann 9a35bc2ae5 hostap: avoid uninitialized variable use in hfa384x_get_rid
commit 48dc5fb3ba53b20418de8514700f63d88c5de3a3 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
..
hostap.h
hostap_80211.h
hostap_80211_rx.c wireless: slight optimization of addr compare 2013-12-26 13:31:35 -05:00
hostap_80211_tx.c wireless: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:36 -05:00
hostap_ap.c wireless: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:36 -05:00
hostap_ap.h
hostap_common.h
hostap_config.h
hostap_cs.c hostap_cs: fix misspelling of current function in string 2014-12-15 13:46:19 -05:00
hostap_download.c hostap: Don't use create_proc_read_entry() 2013-04-29 15:41:56 -04:00
hostap_hw.c hostap: avoid uninitialized variable use in hfa384x_get_rid 2017-04-30 05:49:28 +02:00
hostap_info.c wireless: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:36 -05:00
hostap_ioctl.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-01-10 10:59:40 -05:00
hostap_main.c net: hostap: convert to using IFF_NO_QUEUE 2015-08-18 11:55:07 -07:00
hostap_pci.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
hostap_plx.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
hostap_proc.c wireless: hostap: proc: print properly escaped SSID 2014-10-14 02:18:27 +02:00
hostap_wlan.h wireless: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:36 -05:00
Kconfig
Makefile