mirror of https://gitee.com/openkylin/linux.git
vxge: use pci_dma_mapping_error to test return value
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>
This commit is contained in:
parent
31b683b644
commit
fa15e99b6b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue