rtlwifi: rtl8723be: Fix array dimension problems
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 10 Mar 2014 23:53:10 +0000 (18:53 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 13 Mar 2014 18:05:40 +0000 (14:05 -0400)
commit4e3b3bcd81776527fa6f11624d68849de8c8802e
tree3d63e3f9080c7c13abafbfbc0514278899fa02d3
parent3ead0d2e220ea7ced14027336bb168bafa01b7af
rtlwifi: rtl8723be: Fix array dimension problems

Commit a619d1abe20c leads to the following static checker warning:

drivers/net/wireless/rtlwifi/rtl8723be/phy.c:667 _rtl8723be_store_tx_power_by_rate()
error: buffer overflow 'rtlphy->tx_power_by_rate_offset[band]' 4 <= 5

This warning arises because the code is testing the indices for the wrong maximum
values. In addition, the tests merely putput a warning, and then procedes to
corrupt memory. With this change, any such invalid memory access is avoided.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8723be/phy.c