summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rsi
diff options
context:
space:
mode:
authorJahnavi Meher <jahnavi.meher@gmail.com>2014-06-25 12:17:45 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-06-25 21:40:40 +0200
commit688df7ec26ffde2c8d79b0ac1a3378155da59ff2 (patch)
tree2b35777d4be83942c174cc3faf831ba6fd97c573 /drivers/net/wireless/rsi
parentp54: use request_firmware_direct() for optional EEPROM override (diff)
downloadlinux-688df7ec26ffde2c8d79b0ac1a3378155da59ff2.tar.xz
linux-688df7ec26ffde2c8d79b0ac1a3378155da59ff2.zip
rsi: Fixed errors and warnings reported by static code analyzers.
Fixed a potential buffer overflow in 'rsi_rates' and a sparse warning related to difference in endianness in rsi_91x_mgmt.c. Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rsi')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_mgmt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 83abe580cf5f..8d110fd9eba1 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -1055,7 +1055,8 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
rate_table_offset = 4;
}
- for (ii = 0, jj = 0; ii < ARRAY_SIZE(rsi_rates); ii++) {
+ for (ii = 0, jj = 0;
+ ii < (ARRAY_SIZE(rsi_rates) - rate_table_offset); ii++) {
if (rate_bitmap & BIT(ii)) {
selected_rates[jj++] =
(rsi_rates[ii + rate_table_offset].bitrate / 5);
@@ -1103,7 +1104,7 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
}
for (; ii < RSI_TBL_SZ; ii++)
- auto_rate->supported_rates[ii] = min_rate;
+ auto_rate->supported_rates[ii] = cpu_to_le16(min_rate);
auto_rate->num_supported_rates = cpu_to_le16(num_supported_rates * 2);
auto_rate->moderate_rate_inx = cpu_to_le16(num_supported_rates / 2);