mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 03:55:09 +08:00
ethernet: aquantia: fix dma_mapping_error test
dma_mapping_error() returns 1 if there is an error and 0 if not.
Fixes: 018423e90b
("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>
This commit is contained in:
parent
cdb478e5e4
commit
ff1176f616
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user