From: Dan Carpenter Date: Wed, 1 Feb 2017 08:52:15 +0000 (+0300) Subject: ethernet: aquantia: fix dma_mapping_error test X-Git-Tag: v4.14-rc1~1463^2~265 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff1176f6164f3d151ee64c05d3f7b6662a81b982;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index 817c145..dea9e9b 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; }