tree b6903b12d4124a6fa835cab4b35db1eb99a6d1aa parent e797637f4c1cbcecb2d8f5cfa05b161da1f0b802 author Dale Farnsworth <[EMAIL PROTECTED]> Thu, 01 Sep 2005 23:59:23 -0700 committer Jeff Garzik <[EMAIL PROTECTED]> Tue, 06 Sep 2005 02:08:30 -0400
[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 <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> drivers/net/mv643xx_eth.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -412,15 +412,13 @@ static int mv643xx_eth_receive_queue(str 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; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html