[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1214225712-25882-1-git-send-email-sr@denx.de>
Date: Mon, 23 Jun 2008 14:55:12 +0200
From: Stefan Roese <sr@...x.de>
To: linuxppc-dev@...abs.org, netdev@...r.kernel.org
Cc: benh@...nel.crashing.org, Sathya Narayanan <sathyan@...mf1.com>
Subject: [PATCH] ibm_newemac: Fixes memory leak in ibm_newemac ethernet driver
From: Sathya Narayanan <sathyan@...mf1.com>
This patch addresses the memory leak happenning in drivers transmit queue
under heavy load condition. Once the transmit queue becomes full, driver
does an automatic wrapup of queue. During which the untransmitted SKB's are
lost without getting freed up.
Signed-off-by: Sathya Narayanan <sathyan@...mf1.com>
Signed-off-by: Stefan Roese <sr@...x.de>
---
drivers/net/ibm_newemac/core.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index aa407b2..ee868b6 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -1328,6 +1328,13 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
DBG2(dev, "xmit(%u) %d" NL, len, slot);
+ if (dev->tx_skb[slot] && dev->tx_desc[slot].data_ptr) {
+ dev_kfree_skb(dev->tx_skb[slot]);
+ dev->tx_skb[slot] = NULL;
+ dev->tx_cnt--;
+ ++dev->estats.tx_dropped;
+ }
+
dev->tx_skb[slot] = skb;
dev->tx_desc[slot].data_ptr = dma_map_single(&dev->ofdev->dev,
skb->data, len,
--
1.5.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists