summaryrefslogtreecommitdiffstats
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
authorDale Farnsworth <dale@farnsworth.org>2005-09-01 18:59:23 +0200
committerJeff Garzik <jgarzik@pobox.com>2005-09-06 00:08:30 +0200
commitb1dd9ca177bd2ff5260376dd024dd43eb4631dc7 (patch)
treeb6903b12d4124a6fa835cab4b35db1eb99a6d1aa /drivers/net/mv643xx_eth.c
parent[PATCH] sis190: basic sis191 support (diff)
downloadlinux-b1dd9ca177bd2ff5260376dd024dd43eb4631dc7.tar.xz
linux-b1dd9ca177bd2ff5260376dd024dd43eb4631dc7.zip
[PATCH] mv643xx: fix skb memory leak
This patch fixes an skb memory leak under heavy receive load (whenever the more packets have been received than the NAPI budget allows to be processed). Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index fb6b232069d6..ab74d4583c41 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -412,15 +412,13 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
struct pkt_info pkt_info;
#ifdef MV643XX_NAPI
- while (eth_port_receive(mp, &pkt_info) == ETH_OK && budget > 0) {
+ while (budget-- > 0 && eth_port_receive(mp, &pkt_info) == ETH_OK) {
#else
while (eth_port_receive(mp, &pkt_info) == ETH_OK) {
#endif
mp->rx_ring_skbs--;
received_packets++;
-#ifdef MV643XX_NAPI
- budget--;
-#endif
+
/* Update statistics. Note byte count includes 4 byte CRC count */
stats->rx_packets++;
stats->rx_bytes += pkt_info.byte_cnt;