summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2010-03-29 15:42:23 +0000
committerDavid S. Miller <davem@davemloft.net>2010-03-30 23:03:16 -0700
commit7c0d10d35f7f47d00cc5f2b85ee5e95c2b1fdb7e (patch)
treef05d4843bd0baa72893e099107d5296168dcfac7 /drivers
parentbaff42ab1494528907bf4d5870359e31711746ae (diff)
gianfar: Fix a memory leak in gianfar close code
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/gianfar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 669de028d44..c98fead8412 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -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);
}