Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f16da51 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

lpc_eth: fix tx completion



__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: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarRoland Stigge <stigge@antcom.de>
Tested-by: default avatarRoland Stigge <stigge@antcom.de>
Cc: Kevin Wells <kevin.wells@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3047859
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -946,17 +946,17 @@ 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 (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)
{