Commit b681ee77 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by David S. Miller

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: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarSathya Perla <sathyap@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fac6da5b
...@@ -404,7 +404,7 @@ static void unmap_tx_frag(struct pci_dev *pdev, struct be_eth_wrb *wrb, ...@@ -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)); be_dws_le_to_cpu(wrb, sizeof(*wrb));
dma = (u64)wrb->frag_pa_hi << 32 | (u64)wrb->frag_pa_lo; dma = (u64)wrb->frag_pa_hi << 32 | (u64)wrb->frag_pa_lo;
if (dma != 0) { if (wrb->frag_len) {
if (unmap_single) if (unmap_single)
pci_unmap_single(pdev, dma, wrb->frag_len, pci_unmap_single(pdev, dma, wrb->frag_len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment