android_kernel_samsung_msm8976/drivers/net/wireless/ath/ath9k
Arnd Bergmann d6a8ef9f85 ath9k: fix buffer overrun for ar9287
commit 83d6f1f15f8cce844b0a131cbc63e444620e48b5 upstream.

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: Willy Tarreau <w@1wt.eu>
2016-06-07 10:42:49 +02:00
..
Kconfig ath9k: Use minstrel rate control by default 2013-06-12 10:20:58 -04:00
Makefile ath9k: Use minstrel rate control by default 2013-06-12 10:20:58 -04:00
ahb.c
ani.c
ani.h
antenna.c
ar955x_1p0_initvals.h
ar5008_initvals.h
ar5008_phy.c ath9k_hw: make various ar5416/ar91xx rf banks const 2013-04-10 14:10:32 -04:00
ar9001_initvals.h
ar9002_calib.c
ar9002_hw.c ath9k_hw: make various ar5416/ar91xx rf banks const 2013-04-10 14:10:32 -04:00
ar9002_initvals.h
ar9002_mac.c ath9k: Fix interrupt handling for the AR9002 family 2014-01-09 12:24:22 -08:00
ar9002_phy.c
ar9002_phy.h
ar9003_2p2_initvals.h Revert "ath9k_hw: Update rx gain initval to improve rx sensitivity" 2013-06-12 10:20:58 -04:00
ar9003_calib.c ath9k_hw: Enable manual peak calibration for AR9485 2013-05-17 14:31:08 -04:00
ar9003_eeprom.c ath9k: Fix XLNA bias strength 2013-12-20 07:45:09 -08:00
ar9003_eeprom.h ath9k: use correct OTP register offsets for AR9550 2013-05-28 13:43:10 -04:00
ar9003_hw.c
ar9003_mac.c
ar9003_mac.h
ar9003_mci.c
ar9003_mci.h
ar9003_paprd.c
ar9003_phy.c ath9k: avoid accessing MRC registers on single-chain devices 2013-09-26 17:18:15 -07:00
ar9003_phy.h ath9k_hw: Assign default xlna config for AR9485 2013-07-25 14:07:29 -07:00
ar9003_rtt.c
ar9003_rtt.h
ar9330_1p1_initvals.h
ar9330_1p2_initvals.h
ar9340_initvals.h
ar9462_2p0_initvals.h ath9k: Fix ETSI compliance for AR9462 2.0 2014-03-23 21:38:12 -07:00
ar9485_initvals.h ath9k_hw: Enable manual peak calibration for AR9485 2013-05-17 14:31:08 -04:00
ar9565_1p0_initvals.h ath9k: Update initvals for AR9565 2013-05-08 17:15:08 -04:00
ar9580_1p0_initvals.h ath9k_hw: change AR9580 initvals to fix a stability issue 2013-04-12 13:22:09 -04:00
ath9k.h ath9k: fix rx descriptor related race condition 2013-09-26 17:18:15 -07:00
beacon.c
btcoex.c
btcoex.h
calib.c ath9k: Do not assign noise for NULL caldata 2013-07-25 14:07:30 -07:00
calib.h ath9k_hw: make various ar5416/ar91xx rf banks const 2013-04-10 14:10:32 -04:00
common.c ath9k_common: remove ath9k_cmn_padpos 2013-04-10 14:10:33 -04:00
common.h ath9k_common: remove ath9k_cmn_padpos 2013-04-10 14:10:33 -04:00
debug.c ath9k: Fix crash on module unload 2013-05-17 14:31:06 -04:00
debug.h ath9k: Fix crash on module unload 2013-05-17 14:31:06 -04:00
dfs.c ath9k: change DFS logging to use ath_dbg() 2013-04-22 15:17:40 -04:00
dfs.h
dfs_debug.c
dfs_debug.h
dfs_pattern_detector.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-04-23 14:09:39 -04:00
dfs_pattern_detector.h ath9k: change DFS logging to use ath_dbg() 2013-04-22 15:17:40 -04:00
dfs_pri_detector.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-04-23 14:09:39 -04:00
dfs_pri_detector.h ath9k: change DFS logging to use ath_dbg() 2013-04-22 15:17:40 -04:00
eeprom.c ath9k: fix buffer overrun for ar9287 2016-06-07 10:42:49 +02:00
eeprom.h
eeprom_4k.c
eeprom_9287.c
eeprom_def.c
gpio.c
hif_usb.c ath9k_htc: reboot firmware if it was loaded 2013-08-11 18:35:22 -07:00
hif_usb.h
htc.h
htc_drv_beacon.c ath9k_common: remove ath9k_cmn_padpos 2013-04-10 14:10:33 -04:00
htc_drv_debug.c
htc_drv_gpio.c
htc_drv_init.c ath9k_htc: do some initial hardware configuration 2013-08-11 18:35:22 -07:00
htc_drv_main.c ath9k_htc: make ->sta_rc_update atomic for most calls 2014-02-22 12:41:26 -08:00
htc_drv_txrx.c ath9k_htc: Restore skb headroom when returning skb to mac80211 2013-09-07 22:09:59 -07:00
htc_hst.c
htc_hst.h
hw-ops.h
hw.c ath9k: Fix noisefloor calibration 2013-07-25 14:07:30 -07:00
hw.h ath9k: fix BE/BK queue order 2015-01-16 06:59:00 -08:00
init.c ath9k: declare required extra tx headroom 2015-11-09 10:12:57 -08:00
link.c
mac.c ath9k_hw: fix hardware queue allocation 2015-01-16 06:59:00 -08:00
mac.h ath9k: detect more kinds of invalid descriptors 2013-04-10 14:10:33 -04:00
main.c ath9k: fix DMA stop sequence for AR9003+ 2015-08-03 09:29:42 -07:00
mci.c
mci.h
pci.c
phy.h
rc.c ath9k: prevent aggregation session deadlocks 2013-05-22 14:28:44 -04:00
rc.h ath9k: Use minstrel rate control by default 2013-06-12 10:20:58 -04:00
recv.c ath9k: fix rx descriptor related race condition 2013-09-26 17:18:15 -07:00
reg.h ath9k_hw: improve performance for AR934x v1.3+ 2013-05-24 12:50:22 -04:00
wmi.c
wmi.h
wow.c
xmit.c ath9k: protect tid->sched check 2014-06-07 13:25:40 -07:00