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

Commit ba7e46ef authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by David S. Miller
Browse files

net: mvneta: Fix missing DMA region unmap



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 is true only for the last fragment of the packet.

This is wrong, however, since every descriptor buffer is DMA mapped and needs
to be unmapped.

Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8eef5f97
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1291,11 +1291,10 @@ static void mvneta_txq_bufs_free(struct mvneta_port *pp,

		mvneta_txq_inc_get(txq);

		if (!skb)
			continue;

		dma_unmap_single(pp->dev->dev.parent, tx_desc->buf_phys_addr,
				 tx_desc->data_size, DMA_TO_DEVICE);
		if (!skb)
			continue;
		dev_kfree_skb_any(skb);
	}
}