提交 fa15e99b 编写于 作者: D Denis Kirjanov 提交者: David S. Miller

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: NDenis Kirjanov <kirjanov@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 31b683b6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册