Commit f690ecaf authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

[PATCH] e100: fix skb leak in tx timeout

* If e100 experiences a transmit timeout, and the tx ring is completely
full at the time, it will leak all of the skbs on the tx ring (because
extra logic is needed to distinguish ring full from ring empty).  Jay
Vosburgh [fubar@us.ibm.com].

Signed-off-by: scott.feldman@intel.com
parent 013ae2dd
......@@ -1323,7 +1323,7 @@ static inline int e100_tx_clean(struct nic *nic)
static void e100_clean_cbs(struct nic *nic)
{
if(nic->cbs) {
while(nic->cb_to_clean != nic->cb_to_use) {
while(nic->cbs_avail != nic->params.cbs.count) {
struct cb *cb = nic->cb_to_clean;
if(cb->skb) {
pci_unmap_single(nic->pdev,
......@@ -1333,8 +1333,8 @@ static void e100_clean_cbs(struct nic *nic)
dev_kfree_skb(cb->skb);
}
nic->cb_to_clean = nic->cb_to_clean->next;
nic->cbs_avail++;
}
nic->cbs_avail = nic->params.cbs.count;
pci_free_consistent(nic->pdev,
sizeof(struct cb) * nic->params.cbs.count,
nic->cbs, nic->cbs_dma_addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment