summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-05-17 02:37:31 -0700
committerReinette Chatre <reinette.chatre@intel.com>2010-06-05 23:17:31 -0700
commit4f5fa2376f3ca46fa497632844872a6f4e224c09 (patch)
treee3779b9409c1f5f96fb51c6b1b095b38a01fc6c5 /drivers/net/wireless/iwlwifi/iwl-3945.c
parentfc66be2a808724d61134e420ef9d7082653c72eb (diff)
downloadlinux-4f5fa2376f3ca46fa497632844872a6f4e224c09.tar.bz2
iwl3945: fix bugs in txq freeing
When we free a txq that had no txb array allocated, we still try to access it. Fix that, and also free all SKBs that may be in the txb array (although it can just be a single one). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 295b67ac8169..fec05b5c334e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -705,16 +705,18 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
for (i = 1; i < counter; i++) {
pci_unmap_single(dev, le32_to_cpu(tfd->tbs[i].addr),
le32_to_cpu(tfd->tbs[i].len), PCI_DMA_TODEVICE);
- if (txq->txb[txq->q.read_ptr].skb[0]) {
- struct sk_buff *skb = txq->txb[txq->q.read_ptr].skb[0];
- if (txq->txb[txq->q.read_ptr].skb[0]) {
- /* Can be called from interrupt context */
+ if (txq->txb) {
+ 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[0] = NULL;
+ txq->txb[txq->q.read_ptr].skb[i - 1] = NULL;
}
}
}
- return ;
}
/**