* [patch net-next] ethernet: aquantia: fix dma_mapping_error test
@ 2017-02-01 8:52 Dan Carpenter
2017-02-01 17:45 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-02-01 8:52 UTC (permalink / raw)
To: David S. Miller, David VomLehn
Cc: Dmitry Bezrukov, Pavel Belous, netdev, kernel-janitors
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>
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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch net-next] ethernet: aquantia: fix dma_mapping_error test
2017-02-01 8:52 [patch net-next] ethernet: aquantia: fix dma_mapping_error test Dan Carpenter
@ 2017-02-01 17:45 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-02-01 17:45 UTC (permalink / raw)
To: dan.carpenter
Cc: vomlehn, Dmitry.Bezrukov, Pavel.Belous, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 1 Feb 2017 11:52:15 +0300
> 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>
Applied, thanks Dan.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-01 17:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 8:52 [patch net-next] ethernet: aquantia: fix dma_mapping_error test Dan Carpenter
2017-02-01 17:45 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).