Skip to content

Commit e864b4c

Browse files
wojtas-marcindavem330
authored andcommitted
net: mvpp2: fix missing DMA region unmap in egress processing
The Tx descriptor release code currently calls dma_unmap_single() and dev_kfree_skb_any() if the descriptor is associated with a non-NULL skb. This condition is true only for the last fragment of the packet. Since every descriptor's buffer is DMA-mapped it has to be properly unmapped. Signed-off-by: Marcin Wojtas <[email protected]> Fixes: 3f51850 ("ethernet: Add new driver for Marvell Armada 375 network unit") Cc: <[email protected]> # v3.18+ Signed-off-by: David S. Miller <[email protected]>
1 parent 3cf9222 commit e864b4c

File tree

1 file changed

+2
-3
lines changed
  • drivers/net/ethernet/marvell

1 file changed

+2
-3
lines changed

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,11 +4401,10 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
44014401

44024402
mvpp2_txq_inc_get(txq_pcpu);
44034403

4404-
if (!skb)
4405-
continue;
4406-
44074404
dma_unmap_single(port->dev->dev.parent, buf_phys_addr,
44084405
skb_headlen(skb), DMA_TO_DEVICE);
4406+
if (!skb)
4407+
continue;
44094408
dev_kfree_skb_any(skb);
44104409
}
44114410
}

0 commit comments

Comments
 (0)