diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2010-06-05 13:24:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-06 20:55:59 -0400 |
commit | b28f6428af279ffb9e97ee00486a29498b7fcfdc (patch) | |
tree | b411e94456bd6af04621648bb288b803915fc9b6 /drivers/net/tg3.c | |
parent | b1d0521059789a138d19c4f940d6eca7d620a6eb (diff) |
tg3: Fix a memory leak on 5717+ devices
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | 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 057e8ebc1b25..86f8798a88e2 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -6229,6 +6229,8 @@ static void tg3_free_rings(struct tg3 *tp) | |||
6229 | for (j = 0; j < tp->irq_cnt; j++) { | 6229 | for (j = 0; j < tp->irq_cnt; j++) { |
6230 | struct tg3_napi *tnapi = &tp->napi[j]; | 6230 | struct tg3_napi *tnapi = &tp->napi[j]; |
6231 | 6231 | ||
6232 | tg3_rx_prodring_free(tp, &tp->prodring[j]); | ||
6233 | |||
6232 | if (!tnapi->tx_buffers) | 6234 | if (!tnapi->tx_buffers) |
6233 | continue; | 6235 | continue; |
6234 | 6236 | ||
@@ -6264,8 +6266,6 @@ static void tg3_free_rings(struct tg3 *tp) | |||
6264 | 6266 | ||
6265 | dev_kfree_skb_any(skb); | 6267 | dev_kfree_skb_any(skb); |
6266 | } | 6268 | } |
6267 | |||
6268 | tg3_rx_prodring_free(tp, &tp->prodring[j]); | ||
6269 | } | 6269 | } |
6270 | } | 6270 | } |
6271 | 6271 | ||