aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 49d3bb84ab6b..8e86611791f0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -107,18 +107,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
107 107
108void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) 108void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
109{ 109{
110 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 110 rt2x00queue_unmap_skb(rt2x00dev, skb);
111
112 if (skbdesc->flags & SKBDESC_DMA_MAPPED_RX) {
113 dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
114 DMA_FROM_DEVICE);
115 }
116
117 if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
118 dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
119 DMA_TO_DEVICE);
120 }
121
122 dev_kfree_skb_any(skb); 111 dev_kfree_skb_any(skb);
123} 112}
124 113
@@ -509,16 +498,11 @@ static int rt2x00queue_alloc_rxskbs(struct rt2x00_dev *rt2x00dev,
509 for (i = 0; i < queue->limit; i++) { 498 for (i = 0; i < queue->limit; i++) {
510 skb = rt2x00queue_alloc_rxskb(rt2x00dev, &queue->entries[i]); 499 skb = rt2x00queue_alloc_rxskb(rt2x00dev, &queue->entries[i]);
511 if (!skb) 500 if (!skb)
512 goto exit; 501 return -ENOMEM;
513 queue->entries[i].skb = skb; 502 queue->entries[i].skb = skb;
514 } 503 }
515 504
516 return 0; 505 return 0;
517
518exit:
519 rt2x00queue_free_skbs(rt2x00dev, queue);
520
521 return -ENOMEM;
522} 506}
523 507
524int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev) 508int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev)