alistair23-linux/drivers/net
Arnd Bergmann 83d6f1f15f ath9k: fix buffer overrun for ar9287
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>
2016-03-14 13:09:49 -04:00
..
appletalk
arcnet
bonding
caif
can can: rcar_can: Add r8a7795 support 2016-03-10 10:30:21 +01:00
cris
dsa net: dsa: mv88e6xxx: avoid writing the same mode 2016-03-10 16:10:31 -05:00
ethernet mlx4: add missing braces in verify_qp_parameters 2016-03-14 13:09:49 -04:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: Move subchannel waiting to rndis_filter_device_remove() 2016-03-07 15:37:50 -05:00
ieee802154
ipvlan
irda
phy at803x: fix suspend/resume for SGMII link 2016-03-13 22:37:08 -04:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
slip
team
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vmxnet3 vmxnet3: avoid calling pskb_may_pull with interrupts disabled 2016-03-07 15:15:24 -05:00
wan farsync: fix off-by-one bug in fst_add_one 2016-03-14 13:09:49 -04:00
wimax
wireless ath9k: fix buffer overrun for ar9287 2016-03-14 13:09:49 -04:00
xen-netback xen-netback: reduce log spam 2016-03-13 22:08:01 -04:00
dummy.c
eql.c
geneve.c gro: Defer clearing of flush bit in tunnel paths 2016-03-13 15:01:00 -04:00
ifb.c
Kconfig macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
LICENSE.SRC
loopback.c
macsec.c macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
macvlan.c
macvtap.c macvtap: always pass ethernet header in linear 2016-03-11 14:45:21 -05:00
Makefile macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c
veth.c
virtio_net.c
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vxlan.c gro: Defer clearing of flush bit in tunnel paths 2016-03-13 15:01:00 -04:00
xen-netfront.c