From: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
To: "John W . Linville" <linville@tuxdriver.com>
Cc: Kirshenbaum Erez <erezk@wilocity.com>,
Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>,
<linux-wireless@vger.kernel.org>,
"Luis R . Rodriguez" <rodrigue@qca.qualcomm.com>,
<wil6210@qca.qualcomm.com>
Subject: [PATCH 1/2] wil6210: fix error path in wil_tx_vring
Date: Sun, 21 Jul 2013 11:34:36 +0300 [thread overview]
Message-ID: <1374395677-16751-2-git-send-email-qca_vkondrat@qca.qualcomm.com> (raw)
In-Reply-To: <1374395677-16751-1-git-send-email-qca_vkondrat@qca.qualcomm.com>
Release fragments in the order of allocation; including one for skb head
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
drivers/net/wireless/ath/wil6210/txrx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 2a9d56a..e563af1 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,
return 0;
dma_error:
/* unmap what we have mapped */
- /* Note: increment @f to operate with positive index */
- for (f++; f > 0; f--) {
+ nr_frags = f + 1; /* frags mapped + one for skb head */
+ for (f = 0; f < nr_frags; f++) {
u16 dmalen;
- struct wil_ctx *ctx = &vring->ctx[i];
+ struct wil_ctx *ctx;
i = (swhead + f) % vring->size;
+ ctx = &vring->ctx[i];
_d = &(vring->va[i].tx);
*d = *_d;
_d->dma.status = TX_DMA_STATUS_DU;
--
1.8.1.2
next prev parent reply other threads:[~2013-07-21 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-21 8:34 [PATCH 0/2] wil6210 checksum offload Vladimir Kondratiev
2013-07-21 8:34 ` Vladimir Kondratiev [this message]
2013-07-21 8:34 ` [PATCH 2/2] wil6210: Enable TCP/UDP checksum HW offload Vladimir Kondratiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374395677-16751-2-git-send-email-qca_vkondrat@qca.qualcomm.com \
--to=qca_vkondrat@qca.qualcomm.com \
--cc=erezk@wilocity.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=rodrigue@qca.qualcomm.com \
--cc=wil6210@qca.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox