linux-uconsole/drivers/net/wireless
Arnd Bergmann a317579bb6 ath9k: fix buffer overrun for ar9287
[ Upstream commit 83d6f1f15f ]

Code that was added back in 2.6.38 has an obvious overflow
when accessing a static array, and at the time it was added
only a code comment was put in front of it as a reminder
to have it reviewed properly.

This has not happened, but gcc-6 now points to the specific
overflow:

drivers/net/wireless/ath/ath9k/eeprom.c: In function 'ath9k_hw_get_gain_boundaries_pdadcs':
drivers/net/wireless/ath/ath9k/eeprom.c:483:44: error: array subscript is above array bounds [-Werror=array-bounds]
     maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4];
                   ~~~~~~~~~~~~~~~~~~~~~~~~~^~~

It turns out that the correct array length exists in the local
'intercepts' variable of this function, so we can just use that
instead of hardcoding '4', so this patch changes all three
instances to use that variable. The other two instances were
already correct, but it's more consistent this way.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 940cd2c12e ("ath9k_hw: merge the ar9287 version of ath9k_hw_get_gain_boundaries_pdadcs")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-20 15:42:03 +09:00
..
ath ath9k: fix buffer overrun for ar9287 2016-04-20 15:42:03 +09:00
b43 driver core update for 4.4-rc1 2015-11-04 21:50:37 -08:00
b43legacy debugfs: Pass bool pointer to debugfs_create_bool() 2015-10-04 11:36:07 +01:00
brcm80211 brcm80211: Add support for brcm4371 2015-10-21 10:57:44 +03:00
cw1200 spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
hostap net: hostap: convert to using IFF_NO_QUEUE 2015-08-18 11:55:07 -07:00
ipw2x00 drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
iwlegacy driver core update for 4.4-rc1 2015-11-04 21:50:37 -08:00
iwlwifi iwlwifi: mvm: Fix paging memory leak 2016-04-12 09:08:58 -07:00
libertas spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
libertas_tf Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
mediatek mac80211: allow to transmit A-MSDU within A-MPDU 2015-09-22 15:21:23 +02:00
mwifiex mwifiex: toggle carrier state in start_ap/stop_ap. 2015-10-28 21:00:01 +02:00
orinoco orinoco_usb: return error in ezusb_probe when alloc_orinocodev fails 2015-10-28 20:55:47 +02:00
p54 spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
prism54
realtek rtlwifi: rtl8723be: Fix module parameter initialization 2016-03-03 15:07:13 -08:00
rsi mac80211: allow to transmit A-MSDU within A-MPDU 2015-09-22 15:21:23 +02:00
rt2x00 Here's another set of patches for the current cycle: 2015-10-22 07:28:41 -07:00
ti wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) 2016-02-17 12:30:56 -08:00
zd1211rw mac80211: convert HW flags to unsigned long bitmap 2015-06-10 16:05:36 +02:00
adm8211.c mac80211: convert HW flags to unsigned long bitmap 2015-06-10 16:05:36 +02:00
adm8211.h
airo.c airo: fix scan after SIOCSIWAP (airo_set_wap) 2015-10-28 20:54:39 +02:00
airo.h
airo_cs.c
at76c50x-usb.c mac80211: convert HW flags to unsigned long bitmap 2015-06-10 16:05:36 +02:00
at76c50x-usb.h
atmel.c
atmel.h
atmel_cs.c
atmel_pci.c
Kconfig New driver: rtl8xxxu (mac80211) 2015-10-21 10:53:29 +03:00
mac80211_hwsim.c remove abs64() 2015-11-09 15:11:24 -08:00
mac80211_hwsim.h
Makefile rtlwifi: rtl818x: Move drivers into new realtek directory 2015-10-14 13:33:10 +03:00
mwl8k.c mac80211: allow to transmit A-MSDU within A-MPDU 2015-09-22 15:21:23 +02:00
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c rndis_wlan: fix checking for default value 2015-09-22 16:14:32 -07:00
wl3501.h
wl3501_cs.c
zd1201.c
zd1201.h