netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 03/10] tg3: Fix a memory leak on 5717+ devices
@ 2010-06-06  3:24 Matt Carlson
  0 siblings, 0 replies; only message in thread
From: Matt Carlson @ 2010-06-06  3:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, andy, mcarlson, Michael Chan

The rx resources for MSI-X interrupt vector 0 were not being freed
correctly.  This happens because the teardown loop continue's to the
next loop iteration if it detects the tx ring for that vector is not
setup, thus bypassing the rx teardown code.  This patch moves the
call to tg3_rx_prodring_free() earlier in the loop.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/tg3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 057e8eb..86f8798 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6229,6 +6229,8 @@ static void tg3_free_rings(struct tg3 *tp)
 	for (j = 0; j < tp->irq_cnt; j++) {
 		struct tg3_napi *tnapi = &tp->napi[j];
 
+		tg3_rx_prodring_free(tp, &tp->prodring[j]);
+
 		if (!tnapi->tx_buffers)
 			continue;
 
@@ -6264,8 +6266,6 @@ static void tg3_free_rings(struct tg3 *tp)
 
 			dev_kfree_skb_any(skb);
 		}
-
-		tg3_rx_prodring_free(tp, &tp->prodring[j]);
 	}
 }
 
-- 
1.6.4.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-06  3:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-06  3:24 [PATCH net-next 03/10] tg3: Fix a memory leak on 5717+ devices Matt Carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).