Skip to content

Commit

Permalink
ath5k: properly drop packets from ops->tx
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Mar 28, 2009
1 parent de00c04 commit 5a0fe8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
if (skb_headroom(skb) < padsize) {
ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough"
" headroom to pad %d\n", hdrlen, padsize);
return NETDEV_TX_BUSY;
goto drop_packet;
}
skb_push(skb, padsize);
memmove(skb->data, skb->data+padsize, hdrlen);
Expand All @@ -2573,7 +2573,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
ATH5K_ERR(sc, "no further txbuf available, dropping packet\n");
spin_unlock_irqrestore(&sc->txbuflock, flags);
ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
return NETDEV_TX_BUSY;
goto drop_packet;
}
bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list);
list_del(&bf->list);
Expand All @@ -2590,10 +2590,12 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
list_add_tail(&bf->list, &sc->txbuf);
sc->txbuf_len++;
spin_unlock_irqrestore(&sc->txbuflock, flags);
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
goto drop_packet;
}
return NETDEV_TX_OK;

drop_packet:
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}

Expand Down

0 comments on commit 5a0fe8a

Please sign in to comment.