Skip to content

Commit

Permalink
benet: fix the misusage of zero dma address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
FUJITA Tomonori authored and David S. Miller committed Apr 8, 2010
1 parent fac6da5 commit b681ee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b681ee7

Please sign in to comment.