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

Commit e50b770e authored by Harini Katakam's avatar Harini Katakam Committed by David S. Miller
Browse files

net: macb: Free RX ring for all queues



rx ring is allocated for all queues in macb_alloc_consistent.
Free the same for all queues instead of just Q0.

Signed-off-by: default avatarHarini Katakam <harini.katakam@xilinx.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e1bbdd57
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1812,13 +1812,7 @@ static void macb_free_consistent(struct macb *bp)
	struct macb_queue *queue;
	unsigned int q;

	queue = &bp->queues[0];
	bp->macbgem_ops.mog_free_rx_buffers(bp);
	if (queue->rx_ring) {
		dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp),
				queue->rx_ring, queue->rx_ring_dma);
		queue->rx_ring = NULL;
	}

	for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
		kfree(queue->tx_skb);
@@ -1828,6 +1822,11 @@ static void macb_free_consistent(struct macb *bp)
					  queue->tx_ring, queue->tx_ring_dma);
			queue->tx_ring = NULL;
		}
		if (queue->rx_ring) {
			dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp),
					  queue->rx_ring, queue->rx_ring_dma);
			queue->rx_ring = NULL;
		}
	}
}