diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-02-01 11:52:15 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-01 12:45:27 -0500 |
commit | ff1176f6164f3d151ee64c05d3f7b6662a81b982 (patch) | |
tree | 50565c4765a87c28daf243747c9429cc704b3876 | |
parent | cdb478e5e413864df73096ef4f0e5d518395a92b (diff) | |
download | linux-ff1176f6164f3d151ee64c05d3f7b6662a81b982.tar.bz2 |
ethernet: aquantia: fix dma_mapping_error test
dma_mapping_error() returns 1 if there is an error and 0 if not.
Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index 817c145520c8..dea9e9bbb8e7 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -298,9 +298,10 @@ int aq_ring_rx_fill(struct aq_ring_s *self) buff->page, 0, AQ_CFG_RX_FRAME_MAX, DMA_FROM_DEVICE); - err = dma_mapping_error(aq_nic_get_dev(self->aq_nic), buff->pa); - if (err < 0) + if (dma_mapping_error(aq_nic_get_dev(self->aq_nic), buff->pa)) { + err = -ENOMEM; goto err_exit; + } buff = NULL; } |