From: Vasanthakumar Thiagarajan <vasanth@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, <Luis.Rodriguez@atheros.com>,
<Jouni.Malinen@atheros.com>, <ath9k-devel@lists.ath9k.org>
Subject: [PATCH 3/3] ath9k: downgrade ASSERT() in ath_clone_txbuf()
Date: Wed, 10 Jun 2009 17:50:09 +0530 [thread overview]
Message-ID: <1244636409-9946-4-git-send-email-vasanth@atheros.com> (raw)
In-Reply-To: <1244636409-9946-3-git-send-email-vasanth@atheros.com>
We can easily run out of tx buf if there is any stuck in
transmission, so downgrade it to WARN_ON().
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index e074e6f..c140f81 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -238,6 +238,10 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
struct ath_buf *tbf;
spin_lock_bh(&sc->tx.txbuflock);
+ if (WARN_ON(list_empty(&sc->tx.txbuf))) {
+ spin_unlock_bh(&sc->tx.txbuflock);
+ return NULL;
+ }
ASSERT(!list_empty((&sc->tx.txbuf)));
tbf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list);
list_del(&tbf->list);
@@ -372,6 +376,8 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
struct ath_buf *tbf;
tbf = ath_clone_txbuf(sc, bf_last);
+ if (!tbf)
+ break;
ath9k_hw_cleartxdesc(sc->sc_ah, tbf->bf_desc);
list_add_tail(&tbf->list, &bf_head);
} else {
--
1.5.5.1
prev parent reply other threads:[~2009-06-10 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 12:20 [PATCH 0/3] Few clean ups Vasanthakumar Thiagarajan
2009-06-10 12:20 ` [PATCH 1/3] ath9k: Nuke unneccesary helper function to see if aggr is active Vasanthakumar Thiagarajan
2009-06-10 12:20 ` [PATCH 2/3] ath9k: Remove unnecessary count for addba attempt Vasanthakumar Thiagarajan
2009-06-10 12:20 ` Vasanthakumar Thiagarajan [this message]
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=1244636409-9946-4-git-send-email-vasanth@atheros.com \
--to=vasanth@atheros.com \
--cc=Jouni.Malinen@atheros.com \
--cc=Luis.Rodriguez@atheros.com \
--cc=ath9k-devel@lists.ath9k.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).