Skip to content

Commit

Permalink
tg3: Fix a memory leak on 5717+ devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matt Carlson authored and David S. Miller committed Jun 7, 2010
1 parent b1d0521 commit b28f642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
}
}

Expand Down

0 comments on commit b28f642

Please sign in to comment.