diff options
-rw-r--r-- | 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 e08c8174d656..5de9878d2c12 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) | |||
238 | struct ath_buf *tbf; | 238 | struct ath_buf *tbf; |
239 | 239 | ||
240 | spin_lock_bh(&sc->tx.txbuflock); | 240 | spin_lock_bh(&sc->tx.txbuflock); |
241 | if (WARN_ON(list_empty(&sc->tx.txbuf))) { | ||
242 | spin_unlock_bh(&sc->tx.txbuflock); | ||
243 | return NULL; | ||
244 | } | ||
241 | ASSERT(!list_empty((&sc->tx.txbuf))); | 245 | ASSERT(!list_empty((&sc->tx.txbuf))); |
242 | tbf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); | 246 | tbf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); |
243 | list_del(&tbf->list); | 247 | list_del(&tbf->list); |
@@ -379,6 +383,8 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
379 | struct ath_buf *tbf; | 383 | struct ath_buf *tbf; |
380 | 384 | ||
381 | tbf = ath_clone_txbuf(sc, bf_last); | 385 | tbf = ath_clone_txbuf(sc, bf_last); |
386 | if (!tbf) | ||
387 | break; | ||
382 | ath9k_hw_cleartxdesc(sc->sc_ah, tbf->bf_desc); | 388 | ath9k_hw_cleartxdesc(sc->sc_ah, tbf->bf_desc); |
383 | list_add_tail(&tbf->list, &bf_head); | 389 | list_add_tail(&tbf->list, &bf_head); |
384 | } else { | 390 | } else { |