lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150817082411.GN13546@localhost>
Date:	Mon, 17 Aug 2015 13:54:11 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] net: ethernet: micrel: fix an error code

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@...cle.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;
>  	}

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ