iwlwifi: mvm: check that statistics TLV version match struct version
authorMordechay Goodstein <mordechay.goodstein@intel.com>
Wed, 9 Dec 2020 21:16:49 +0000 (23:16 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 9 Dec 2020 22:16:07 +0000 (00:16 +0200)
FW now puts in the struct version, the TLV version so we also check
it to make sure it matches.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201209231352.bc1dfb56ffbd.I99d8085cccc8687805781ccc43e189dbcef0e63b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rx.c

index 79d1778e6bc0e6d6b38d4d6a383e140a8a087aee..b562e07a5f229704775f6e436297e09476d26dfe 100644 (file)
@@ -707,7 +707,8 @@ iwl_mvm_handle_rx_statistics_tlv(struct iwl_mvm *mvm,
        stats = (void *)&pkt->data;
 
        if (WARN_ONCE(stats->hdr.type != FW_STATISTICS_OPERATIONAL ||
-                     stats->hdr.version != 1,
+                     stats->hdr.version !=
+                     iwl_fw_lookup_notif_ver(mvm->fw, LONG_GROUP, STATISTICS_CMD, 0),
                      "received unsupported hdr type %d, version %d\n",
                      stats->hdr.type, stats->hdr.version))
                return;