Commit f1cbb0a8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Luca Coelho

iwlwifi: mvm: fix off by one in iwl_mvm_stat_iterator_all_macs()

Change the comparison from ">" to ">=" to avoid accessing one element
beyond the end of the ->per_mac_stats[] array.

Fixes: 6324c173 ("iwlwifi: mvm: add support for statistics update version 15")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220106071825.GA5836@kiliSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 0eb50c67
......@@ -640,7 +640,7 @@ static void iwl_mvm_stat_iterator_all_macs(void *_data, u8 *mac,
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
u16 vif_id = mvmvif->id;
if (WARN_ONCE(vif_id > MAC_INDEX_AUX, "invalid vif id: %d", vif_id))
if (WARN_ONCE(vif_id >= MAC_INDEX_AUX, "invalid vif id: %d", vif_id))
return;
if (vif->type != NL80211_IFTYPE_STATION)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment