Skip to content

Commit

Permalink
net: mvneta: Fix missing DMA region unmap
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ezequielgarcia authored and davem330 committed Jun 2, 2014
1 parent 8eef5f9 commit ba7e46e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit ba7e46e

Please sign in to comment.