Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c0d10d3 authored by Andy Fleming's avatar Andy Fleming Committed by David S. Miller
Browse files

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: default avatarAndy Fleming <afleming@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent baff42ab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
	}