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: <DC148C5AA1CEBA4E87973D432B1C2D88261024FC@P3PWEX4MB008.ex4.secureserver.net>
Date:	Wed, 4 Feb 2015 15:59:32 +0000
From:	Hartley Sweeten <HartleyS@...ionengravers.com>
To:	SF Markus Elfring <elfring@...rs.sourceforge.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	LKML <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
	Julia Lawall <julia.lawall@...6.fr>
Subject: RE: [PATCH] net: ep93xx_eth: Delete unnecessary checks before the
 function call "kfree"

On Wednesday, February 04, 2015 8:01 AM, Markus Elfring wrote:
> The kfree() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/net/ethernet/cirrus/ep93xx_eth.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c
> index 3a12c09..de9f7c9 100644
> --- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
> +++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
> @@ -475,8 +475,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
>  		if (d)
>  			dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE);
>  
> -		if (ep->rx_buf[i] != NULL)
> -			kfree(ep->rx_buf[i]);
> +		kfree(ep->rx_buf[i]);
>  	}
>  
>  	for (i = 0; i < TX_QUEUE_ENTRIES; i++) {
> @@ -486,8 +485,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
>  		if (d)
>  			dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE);
>  
> -		if (ep->tx_buf[i] != NULL)
> -			kfree(ep->tx_buf[i]);
> +		kfree(ep->tx_buf[i]);
>  	}
>  
>  	dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ