Commit ff1176f6 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

ethernet: aquantia: fix dma_mapping_error test

dma_mapping_error() returns 1 if there is an error and 0 if not.

Fixes: 018423e9 ("net: ethernet: aquantia: Add ring support code")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cdb478e5
...@@ -298,9 +298,10 @@ int aq_ring_rx_fill(struct aq_ring_s *self) ...@@ -298,9 +298,10 @@ int aq_ring_rx_fill(struct aq_ring_s *self)
buff->page, 0, buff->page, 0,
AQ_CFG_RX_FRAME_MAX, DMA_FROM_DEVICE); AQ_CFG_RX_FRAME_MAX, DMA_FROM_DEVICE);
err = dma_mapping_error(aq_nic_get_dev(self->aq_nic), buff->pa); if (dma_mapping_error(aq_nic_get_dev(self->aq_nic), buff->pa)) {
if (err < 0) err = -ENOMEM;
goto err_exit; goto err_exit;
}
buff = NULL; buff = NULL;
} }
......
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