From: Brian King Date: Wed, 7 Sep 2011 14:41:03 +0000 (+0000) Subject: ibmveth: Fix DMA unmap error X-Git-Tag: v3.0.5~114 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=63bac6629520236226e54128c873871f1ff1f018;p=karo-tx-linux.git ibmveth: Fix DMA unmap error commit 33a48ab105a75d37021e422a0a3283241099b142 upstream. Commit 6e8ab30ec677 (ibmveth: Add scatter-gather support) introduced a DMA mapping API inconsistency resulting in dma_unmap_page getting called on memory mapped via dma_map_single. This was seen when CONFIG_DMA_API_DEBUG was enabled. Fix up this API usage inconsistency. Signed-off-by: Brian King Acked-by: Anton Blanchard Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index f9d49cc75175..dc9bac0e92fa 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -1025,7 +1025,12 @@ retry_bounce: netdev->stats.tx_bytes += skb->len; } - for (i = 0; i < skb_shinfo(skb)->nr_frags + 1; i++) + dma_unmap_single(&adapter->vdev->dev, + descs[0].fields.address, + descs[0].fields.flags_len & IBMVETH_BUF_LEN_MASK, + DMA_TO_DEVICE); + + for (i = 1; i < skb_shinfo(skb)->nr_frags + 1; i++) dma_unmap_page(&adapter->vdev->dev, descs[i].fields.address, descs[i].fields.flags_len & IBMVETH_BUF_LEN_MASK, DMA_TO_DEVICE);