diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-03-23 23:35:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:19 -0400 |
commit | 5a0fe8ac70f81b5b91156736066e6445d0dcc61f (patch) | |
tree | a348f244f66a5a594e08dccdaefd7d97d0472e8e /drivers/net/wireless/ath5k | |
parent | de00c04ecbb482507ace2197782123446a1cfdca (diff) |
ath5k: properly drop packets from ops->tx
We shouldn't return NETDEV_TX_BUSY from the TX callback, especially
after we've mucked with the sk_buffs. Drop the packets and return
NETDEV_TX_OK.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 6580df2f7443..5d57d774e466 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -2562,7 +2562,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2562 | if (skb_headroom(skb) < padsize) { | 2562 | if (skb_headroom(skb) < padsize) { |
2563 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" | 2563 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" |
2564 | " headroom to pad %d\n", hdrlen, padsize); | 2564 | " headroom to pad %d\n", hdrlen, padsize); |
2565 | return NETDEV_TX_BUSY; | 2565 | goto drop_packet; |
2566 | } | 2566 | } |
2567 | skb_push(skb, padsize); | 2567 | skb_push(skb, padsize); |
2568 | memmove(skb->data, skb->data+padsize, hdrlen); | 2568 | memmove(skb->data, skb->data+padsize, hdrlen); |
@@ -2573,7 +2573,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2573 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); | 2573 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); |
2574 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2574 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2575 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); | 2575 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); |
2576 | return NETDEV_TX_BUSY; | 2576 | goto drop_packet; |
2577 | } | 2577 | } |
2578 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); | 2578 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); |
2579 | list_del(&bf->list); | 2579 | list_del(&bf->list); |
@@ -2590,10 +2590,12 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2590 | list_add_tail(&bf->list, &sc->txbuf); | 2590 | list_add_tail(&bf->list, &sc->txbuf); |
2591 | sc->txbuf_len++; | 2591 | sc->txbuf_len++; |
2592 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2592 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2593 | dev_kfree_skb_any(skb); | 2593 | goto drop_packet; |
2594 | return NETDEV_TX_OK; | ||
2595 | } | 2594 | } |
2595 | return NETDEV_TX_OK; | ||
2596 | 2596 | ||
2597 | drop_packet: | ||
2598 | dev_kfree_skb_any(skb); | ||
2597 | return NETDEV_TX_OK; | 2599 | return NETDEV_TX_OK; |
2598 | } | 2600 | } |
2599 | 2601 | ||