netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] net: ethernet: micrel: fix an error code
Date: Mon, 17 Aug 2015 13:54:11 +0530	[thread overview]
Message-ID: <20150817082411.GN13546@localhost> (raw)
In-Reply-To: <20150814085459.GC30728@mwanda>

On Fri, Aug 14, 2015 at 11:54:59AM +0300, Dan Carpenter wrote:
> The dma_mapping_error() function returns true or false.  We should
> return -ENOMEM if it there is a dma mapping error.

Looks good to me, but should be sent to net folks now me :)

-- 
~Vinod
 
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
> index f78909a..09d2e16 100644
> --- a/drivers/net/ethernet/micrel/ks8842.c
> +++ b/drivers/net/ethernet/micrel/ks8842.c
> @@ -952,9 +952,8 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev)
>  
>  	sg_dma_address(&tx_ctl->sg) = dma_map_single(adapter->dev,
>  		tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE);
> -	err = dma_mapping_error(adapter->dev,
> -		sg_dma_address(&tx_ctl->sg));
> -	if (err) {
> +	if (dma_mapping_error(adapter->dev, sg_dma_address(&tx_ctl->sg))) {
> +		err = -ENOMEM;
>  		sg_dma_address(&tx_ctl->sg) = 0;
>  		goto err;
>  	}

  reply	other threads:[~2015-08-17  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14  8:54 [patch] net: ethernet: micrel: fix an error code Dan Carpenter
2015-08-17  8:24 ` Vinod Koul [this message]
2015-08-17 19:23 ` 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=20150817082411.GN13546@localhost \
    --to=vinod.koul@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).