mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
[PATCH] mv643xx_eth: Fix transmit skb accounting
Signed-off-by: Dale Farnsworth <dale@farnsworth.org> mv643xx_eth.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
parent
63890576a3
commit
4476e0e4c7
1 changed files with 5 additions and 2 deletions
|
@ -889,14 +889,17 @@ static void mv643xx_eth_free_tx_rings(struct net_device *dev)
|
||||||
struct mv643xx_private *mp = netdev_priv(dev);
|
struct mv643xx_private *mp = netdev_priv(dev);
|
||||||
unsigned int port_num = mp->port_num;
|
unsigned int port_num = mp->port_num;
|
||||||
unsigned int curr;
|
unsigned int curr;
|
||||||
|
struct sk_buff *skb;
|
||||||
|
|
||||||
/* Stop Tx Queues */
|
/* Stop Tx Queues */
|
||||||
mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
|
mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
|
||||||
|
|
||||||
/* Free outstanding skb's on TX rings */
|
/* Free outstanding skb's on TX rings */
|
||||||
for (curr = 0; mp->tx_ring_skbs && curr < mp->tx_ring_size; curr++) {
|
for (curr = 0; mp->tx_ring_skbs && curr < mp->tx_ring_size; curr++) {
|
||||||
if (mp->tx_skb[curr]) {
|
skb = mp->tx_skb[curr];
|
||||||
dev_kfree_skb(mp->tx_skb[curr]);
|
if (skb) {
|
||||||
|
mp->tx_ring_skbs -= skb_shinfo(skb)->nr_frags;
|
||||||
|
dev_kfree_skb(skb);
|
||||||
mp->tx_ring_skbs--;
|
mp->tx_ring_skbs--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue