aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2013-07-21 04:34:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-07-22 16:54:44 -0400
commitc2a146f61014543fc4b52acaddcaa31b9f17453d (patch)
tree831090e251d6135077dfd8a1deedbb232b1ee5ee /drivers/net/wireless/ath/wil6210
parentf291f7deeeef84bd113ff3c309862a888e8f181b (diff)
wil6210: fix error path in wil_tx_vring
Release fragments in the order of allocation; including one for skb head Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 2a9d56a5fd0c..e563af13740b 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -730,12 +730,13 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
730 return 0; 730 return 0;
731 dma_error: 731 dma_error:
732 /* unmap what we have mapped */ 732 /* unmap what we have mapped */
733 /* Note: increment @f to operate with positive index */ 733 nr_frags = f + 1; /* frags mapped + one for skb head */
734 for (f++; f > 0; f--) { 734 for (f = 0; f < nr_frags; f++) {
735 u16 dmalen; 735 u16 dmalen;
736 struct wil_ctx *ctx = &vring->ctx[i]; 736 struct wil_ctx *ctx;
737 737
738 i = (swhead + f) % vring->size; 738 i = (swhead + f) % vring->size;
739 ctx = &vring->ctx[i];
739 _d = &(vring->va[i].tx); 740 _d = &(vring->va[i].tx);
740 *d = *_d; 741 *d = *_d;
741 _d->dma.status = TX_DMA_STATUS_DU; 742 _d->dma.status = TX_DMA_STATUS_DU;