aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-04-20 10:01:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-20 16:05:59 -0400
commit069f40fc07f6df3da325e7ea1698a0d6247983d5 (patch)
tree2717c5d0c0f1437e63b6d77565b1fd4dc39b13b2 /drivers/net/wireless/iwlegacy/iwl-4965-tx.c
parentb25026981aecde3685dd0e45ad980fff9f528daa (diff)
iwl4965: fix skb usage after free
Since commit a120e912eb51e347f36c71b60a1d13af74d30e83 Author: Stanislaw Gruszka <sgruszka@redhat.com> Date: Fri Feb 19 15:47:33 2010 -0800 iwlwifi: sanity check before counting number of tfds can be free we use skb->data after calling ieee80211_tx_status_irqsafe(), which could free skb instantly. On current kernels I do not observe practical problems related with bug, but on 2.6.35.y it cause random system hangs when stressing wireless link, making bisection of other problems impossible. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-4965-tx.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 5c40502f869a..fbec88d48f1b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -1127,12 +1127,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1127 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1127 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1128 1128
1129 tx_info = &txq->txb[txq->q.read_ptr]; 1129 tx_info = &txq->txb[txq->q.read_ptr];
1130 iwl4965_tx_status(priv, tx_info, 1130
1131 txq_id >= IWL4965_FIRST_AMPDU_QUEUE); 1131 if (WARN_ON_ONCE(tx_info->skb == NULL))
1132 continue;
1132 1133
1133 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1134 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1134 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1135 if (ieee80211_is_data_qos(hdr->frame_control))
1135 nfreed++; 1136 nfreed++;
1137
1138 iwl4965_tx_status(priv, tx_info,
1139 txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
1136 tx_info->skb = NULL; 1140 tx_info->skb = NULL;
1137 1141
1138 priv->cfg->ops->lib->txq_free_tfd(priv, txq); 1142 priv->cfg->ops->lib->txq_free_tfd(priv, txq);