Commit 61243d8e authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Remove duplicate deinitialization

When rt2x00queue_alloc_rxskbs() fails rt2x00queue_unitialize()
will be called which will free all rxskb. So we don't need
to do this in the rt2x00queue_alloc_rxskb() function as well.

rt2x00queue_free_skb() unmaps the DMA but doesn't clear the
allocation flag. Since the code is copied from rt2x00queue_unmap_skb()
anyway (and that function does clear the flag) we might as well
use that function directly.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 923fd703
...@@ -107,18 +107,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) ...@@ -107,18 +107,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); rt2x00queue_unmap_skb(rt2x00dev, skb);
if (skbdesc->flags & SKBDESC_DMA_MAPPED_RX) {
dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
DMA_FROM_DEVICE);
}
if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
DMA_TO_DEVICE);
}
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
...@@ -509,16 +498,11 @@ static int rt2x00queue_alloc_rxskbs(struct rt2x00_dev *rt2x00dev, ...@@ -509,16 +498,11 @@ static int rt2x00queue_alloc_rxskbs(struct rt2x00_dev *rt2x00dev,
for (i = 0; i < queue->limit; i++) { for (i = 0; i < queue->limit; i++) {
skb = rt2x00queue_alloc_rxskb(rt2x00dev, &queue->entries[i]); skb = rt2x00queue_alloc_rxskb(rt2x00dev, &queue->entries[i]);
if (!skb) if (!skb)
goto exit; return -ENOMEM;
queue->entries[i].skb = skb; queue->entries[i].skb = skb;
} }
return 0; return 0;
exit:
rt2x00queue_free_skbs(rt2x00dev, queue);
return -ENOMEM;
} }
int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev) int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment