iwlwifi: need check for valid qos packet before free

For 4965, need to check it is valid qos frame before free, only valid
QoS frame has the tid used to free the packets.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by Wey-Yi Guy and committed by John W. Linville ece6444c 11446011

+9 -4
+9 -4
drivers/net/wireless/iwlwifi/iwl-4965.c
··· 2015 2015 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn " 2016 2016 "%d index %d\n", scd_ssn , index); 2017 2017 freed = iwl_tx_queue_reclaim(priv, txq_id, index); 2018 - iwl_free_tfds_in_queue(priv, sta_id, tid, freed); 2018 + if (qc) 2019 + iwl_free_tfds_in_queue(priv, sta_id, 2020 + tid, freed); 2019 2021 2020 2022 if (priv->mac80211_registered && 2021 2023 (iwl_queue_space(&txq->q) > txq->q.low_mark) && ··· 2043 2041 tx_resp->failure_frame); 2044 2042 2045 2043 freed = iwl_tx_queue_reclaim(priv, txq_id, index); 2046 - iwl_free_tfds_in_queue(priv, sta_id, tid, freed); 2044 + if (qc && likely(sta_id != IWL_INVALID_STATION)) 2045 + iwl_free_tfds_in_queue(priv, sta_id, tid, freed); 2046 + else if (sta_id == IWL_INVALID_STATION) 2047 + IWL_DEBUG_TX_REPLY(priv, "Station not known\n"); 2047 2048 2048 2049 if (priv->mac80211_registered && 2049 2050 (iwl_queue_space(&txq->q) > txq->q.low_mark)) 2050 2051 iwl_wake_queue(priv, txq_id); 2051 2052 } 2052 - 2053 - iwl_txq_check_empty(priv, sta_id, tid, txq_id); 2053 + if (qc && likely(sta_id != IWL_INVALID_STATION)) 2054 + iwl_txq_check_empty(priv, sta_id, tid, txq_id); 2054 2055 2055 2056 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 2056 2057 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");