Skip to content

Commit 4494541

Browse files
Eyal Shapiraegrumbach
authored andcommitted
iwlwifi: mvm: rs: fix a theoretical access to uninitialized array elements
Klocwork is unhappy as ht_vht_rates might be accessed with rate->index being set to values between 0 and 3 which will lead to accessing uninitialized array elements. Effectively this doesn't happen as in HT/VHT we're not using these rate indices. Still fix this. Signed-off-by: Eyal Shapira <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]>
1 parent a339e91 commit 4494541

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+1
-0
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ static char *rs_pretty_rate(const struct rs_rate *rate)
556556
if (is_type_legacy(rate->type) && (rate->index <= IWL_RATE_54M_INDEX))
557557
rate_str = legacy_rates[rate->index];
558558
else if ((is_type_ht(rate->type) || is_type_vht(rate->type)) &&
559+
(rate->index >= IWL_RATE_MCS_0_INDEX) &&
559560
(rate->index <= IWL_RATE_MCS_9_INDEX))
560561
rate_str = ht_vht_rates[rate->index];
561562
else

0 commit comments

Comments
 (0)