Skip to content

Commit

Permalink
gianfar: Fix a memory leak in gianfar close code
Browse files Browse the repository at this point in the history
gianfar needed to ensure existence of the *skbuff arrays before
freeing the skbs in them, rather than ensuring their nonexistence.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Fleming authored and David S. Miller committed Mar 31, 2010
1 parent baff42a commit 7c0d10d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,13 +1638,13 @@ static void free_skb_resources(struct gfar_private *priv)
/* Go through all the buffer descriptors and free their data buffers */
for (i = 0; i < priv->num_tx_queues; i++) {
tx_queue = priv->tx_queue[i];
if(!tx_queue->tx_skbuff)
if(tx_queue->tx_skbuff)
free_skb_tx_queue(tx_queue);
}

for (i = 0; i < priv->num_rx_queues; i++) {
rx_queue = priv->rx_queue[i];
if(!rx_queue->rx_skbuff)
if(rx_queue->rx_skbuff)
free_skb_rx_queue(rx_queue);
}

Expand Down

0 comments on commit 7c0d10d

Please sign in to comment.