aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2010-04-04 17:40:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-07 23:59:26 -0400
commitb681ee77f8ad248b0fdcec2e5e8c4df6e757eba3 (patch)
tree6857b8e1dac8847855eb4baaf3632f55035369a7 /drivers/net/benet
parentfac6da5b7a1b9779ba124ce92314d02378892855 (diff)
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 <fujita.tomonori@lab.ntt.co.jp> Acked-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c2
1 files changed, 1 insertions, 1 deletions
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,
404 be_dws_le_to_cpu(wrb, sizeof(*wrb)); 404 be_dws_le_to_cpu(wrb, sizeof(*wrb));
405 405
406 dma = (u64)wrb->frag_pa_hi << 32 | (u64)wrb->frag_pa_lo; 406 dma = (u64)wrb->frag_pa_hi << 32 | (u64)wrb->frag_pa_lo;
407 if (dma != 0) { 407 if (wrb->frag_len) {
408 if (unmap_single) 408 if (unmap_single)
409 pci_unmap_single(pdev, dma, wrb->frag_len, 409 pci_unmap_single(pdev, dma, wrb->frag_len,
410 PCI_DMA_TODEVICE); 410 PCI_DMA_TODEVICE);