]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
iwlagn: fix bug in txq freeing
authorJohannes Berg <johannes.berg@intel.com>
Mon, 17 May 2010 09:37:32 +0000 (02:37 -0700)
committerReinette Chatre <reinette.chatre@intel.com>
Sun, 6 Jun 2010 06:17:51 +0000 (23:17 -0700)
The iwl_hw_txq_free_tfd() function can be
called from contexts with IRQs disabled,
so it must not call dev_kfree_skb() but
rather dev_kfree_skb_any() instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn.c

index 9c85e1bd297119c57ec242e50bd65a7aa6b374a7..a61d5674d13e90b82f8e4e2704eb035867aa96bd 100644 (file)
@@ -484,8 +484,15 @@ void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
                                iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE);
 
                if (txq->txb) {
-                       dev_kfree_skb(txq->txb[txq->q.read_ptr].skb[i - 1]);
-                       txq->txb[txq->q.read_ptr].skb[i - 1] = NULL;
+                       struct sk_buff *skb;
+
+                       skb = txq->txb[txq->q.read_ptr].skb[i - 1];
+
+                       /* can be called from irqs-disabled context */
+                       if (skb) {
+                               dev_kfree_skb_any(skb);
+                               txq->txb[txq->q.read_ptr].skb[i - 1] = NULL;
+                       }
                }
        }
 }