diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2014-05-30 13:40:06 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-02 16:16:05 -0700 |
commit | ba7e46ef9d4550f76efb70739728c50bbf94c3a9 (patch) | |
tree | 09f4767a4016a3d527257ec80a3ab9c2c8ad97df /drivers/net/ethernet/marvell | |
parent | 8eef5f9723f987d14de409c0a65e94a83841b28a (diff) | |
download | op-kernel-dev-ba7e46ef9d4550f76efb70739728c50bbf94c3a9.zip op-kernel-dev-ba7e46ef9d4550f76efb70739728c50bbf94c3a9.tar.gz |
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: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 57a2e76..f95e7ca 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -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); } } |