From: FUJITA Tomonori Date: Sun, 4 Apr 2010 21:40:18 +0000 (+0000) Subject: benet: fix the misusage of zero dma address X-Git-Tag: MMI-PSA29.97-13-9~23873^2~539 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b681ee77f8ad248b0fdcec2e5e8c4df6e757eba3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git benet: fix the misusage of zero dma address benet driver wrongly assumes that zero is an invalid dma address (calls dma_unmap_page for only non zero dma addresses). Zero is a valid dma address on some architectures. The dma length can be used here. Signed-off-by: FUJITA Tomonori Acked-by: Sathya Perla Signed-off-by: David S. Miller --- diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 833618339d4d..18e0a80d3e61 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c @@ -404,7 +404,7 @@ static void unmap_tx_frag(struct pci_dev *pdev, struct be_eth_wrb *wrb, be_dws_le_to_cpu(wrb, sizeof(*wrb)); dma = (u64)wrb->frag_pa_hi << 32 | (u64)wrb->frag_pa_lo; - if (dma != 0) { + if (wrb->frag_len) { if (unmap_single) pci_unmap_single(pdev, dma, wrb->frag_len, PCI_DMA_TODEVICE);