netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "David S. Miller" <davem@davemloft.net>,
	David VomLehn <vomlehn@texas.net>
Cc: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>,
	Pavel Belous <Pavel.Belous@aquantia.com>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch net-next] ethernet: aquantia: fix dma_mapping_error test
Date: Wed, 1 Feb 2017 11:52:15 +0300	[thread overview]
Message-ID: <20170201085215.GB31514@mwanda> (raw)

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;
 	}

             reply	other threads:[~2017-02-01  8:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01  8:52 Dan Carpenter [this message]
2017-02-01 17:45 ` [patch net-next] ethernet: aquantia: fix dma_mapping_error test David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170201085215.GB31514@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Dmitry.Bezrukov@aquantia.com \
    --cc=Pavel.Belous@aquantia.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vomlehn@texas.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).