Skip to content

Commit

Permalink
vxge: use pci_dma_mapping_error to test return value
Browse files Browse the repository at this point in the history
pci_dma_mapping_error should be used to test return value of
pci_map_single or pci_map_page.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Jan 10, 2010
1 parent 31b683b commit fa15e99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/vxge/vxge-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int vxge_rx_map(void *dtrh, struct vxge_ring *ring)
dma_addr = pci_map_single(ring->pdev, rx_priv->skb_data,
rx_priv->data_size, PCI_DMA_FROMDEVICE);

if (dma_addr == 0) {
if (unlikely(pci_dma_mapping_error(ring->pdev, dma_addr))) {
ring->stats.pci_map_fail++;
return -EIO;
}
Expand Down

0 comments on commit fa15e99

Please sign in to comment.