Skip to content

Commit

Permalink
lpc_eth: fix tx completion
Browse files Browse the repository at this point in the history
__lpc_handle_xmit() has two bugs :

1) It can leak skbs in case TXSTATUS_ERROR is set

2) It can wake up txqueue while no slot was freed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Roland Stigge <stigge@antcom.de>
Tested-by: Roland Stigge <stigge@antcom.de>
Cc: Kevin Wells <kevin.wells@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 11, 2012
1 parent e304785 commit 3f16da5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/nxp/lpc_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,16 +946,16 @@ static void __lpc_handle_xmit(struct net_device *ndev)
/* Update stats */
ndev->stats.tx_packets++;
ndev->stats.tx_bytes += skb->len;

/* Free buffer */
dev_kfree_skb_irq(skb);
}
dev_kfree_skb_irq(skb);

txcidx = readl(LPC_ENET_TXCONSUMEINDEX(pldat->net_base));
}

if (netif_queue_stopped(ndev))
netif_wake_queue(ndev);
if (pldat->num_used_tx_buffs <= ENET_TX_DESC/2) {
if (netif_queue_stopped(ndev))
netif_wake_queue(ndev);
}
}

static int __lpc_handle_recv(struct net_device *ndev, int budget)
Expand Down

0 comments on commit 3f16da5

Please sign in to comment.