diff options
author | Mordechai Goodstein <mordechay.goodstein@intel.com> | 2017-06-11 11:00:36 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-07-21 05:26:37 -0400 |
commit | f6eac740a9b6f3737a969bad82931633519a1cc5 (patch) | |
tree | 206e267e308effe16cd623451f3a311cb107b0ea | |
parent | 0b0f934e92a8eaed2e6c48a50eae6f84661f74f3 (diff) |
iwlwifi: pcie: fix unused txq NULL pointer dereference
Before TVQM, all TX queues were allocated straight at init.
With TVQM, queues are allocated on demand and hence we need
to check if a queue exists before dereferencing it.
Fixes: 66128fa08806 ("iwlwifi: move to TVQM mode")
Signed-off-by: Mordechai Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index de50418adae5..034bdb4a0b06 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
@@ -298,6 +298,9 @@ void iwl_pcie_txq_check_wrptrs(struct iwl_trans *trans) | |||
298 | for (i = 0; i < trans->cfg->base_params->num_of_queues; i++) { | 298 | for (i = 0; i < trans->cfg->base_params->num_of_queues; i++) { |
299 | struct iwl_txq *txq = trans_pcie->txq[i]; | 299 | struct iwl_txq *txq = trans_pcie->txq[i]; |
300 | 300 | ||
301 | if (!test_bit(i, trans_pcie->queue_used)) | ||
302 | continue; | ||
303 | |||
301 | spin_lock_bh(&txq->lock); | 304 | spin_lock_bh(&txq->lock); |
302 | if (txq->need_update) { | 305 | if (txq->need_update) { |
303 | iwl_pcie_txq_inc_wr_ptr(trans, txq); | 306 | iwl_pcie_txq_inc_wr_ptr(trans, txq); |