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>
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);
}
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);