iwlwifi: pcie: fix TVQM queue ID range check
authorJohannes Berg <johannes.berg@intel.com>
Wed, 19 Apr 2017 08:29:06 +0000 (10:29 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 22 Jun 2017 21:13:00 +0000 (00:13 +0300)
The queue ID should never be 512 either, so correct the check
to be >= instead of just >.

Fixes: 310181ec34e2 ("iwlwifi: move to TVQM mode")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

index 6e186501f43c5e6dc9b35a5afe27b90d1ee27072..8f00019cd3b4e4a097f35d885f1616270e135dab 100644 (file)
@@ -1076,7 +1076,7 @@ int iwl_trans_pcie_dyn_txq_alloc(struct iwl_trans *trans,
        rsp = (void *)hcmd.resp_pkt->data;
        qid = le16_to_cpu(rsp->queue_number);
 
-       if (qid > ARRAY_SIZE(trans_pcie->txq)) {
+       if (qid >= ARRAY_SIZE(trans_pcie->txq)) {
                WARN_ONCE(1, "queue index %d unsupported", qid);
                ret = -EIO;
                goto error_free_resp;