Skip to content

Commit ecf25f0

Browse files
harini-katakamclaudiubeznea
authored andcommitted
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: Harini Katakam <harini.katakam@xilinx.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d83e22c commit ecf25f0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,13 +1812,7 @@ static void macb_free_consistent(struct macb *bp)
18121812
struct macb_queue *queue;
18131813
unsigned int q;
18141814

1815-
queue = &bp->queues[0];
18161815
bp->macbgem_ops.mog_free_rx_buffers(bp);
1817-
if (queue->rx_ring) {
1818-
dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp),
1819-
queue->rx_ring, queue->rx_ring_dma);
1820-
queue->rx_ring = NULL;
1821-
}
18221816

18231817
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
18241818
kfree(queue->tx_skb);
@@ -1828,6 +1822,11 @@ static void macb_free_consistent(struct macb *bp)
18281822
queue->tx_ring, queue->tx_ring_dma);
18291823
queue->tx_ring = NULL;
18301824
}
1825+
if (queue->rx_ring) {
1826+
dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp),
1827+
queue->rx_ring, queue->rx_ring_dma);
1828+
queue->rx_ring = NULL;
1829+
}
18311830
}
18321831
}
18331832

0 commit comments

Comments
 (0)