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] [day] [month] [year] [list]
Message-ID: <20120410074959.GA4393@mwanda>
Date:	Tue, 10 Apr 2012 10:49:59 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	santosh nayak <santoshprasadnayak@...il.com>
Cc:	anirban.chakraborty@...gic.com, rajesh.borundia@...gic.com,
	sony.chacko@...gic.com, linux-driver@...gic.com,
	netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/2] qlcnic: Remove redundant NULL check on kfree().

On Mon, Apr 09, 2012 at 11:41:19AM +0530, santosh nayak wrote:
> From: Santosh Nayak <santoshprasadnayak@...il.com>
> 
> kfree() checks for NULL before freeing the memory.
> Remove redundant NULL check.
> This is just a clean up and also looks good from performance point of view.

I doubt it has any impact on performance.

[snip]

>  static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter)
>  {
> -	if (adapter->fhash.fmax && adapter->fhash.fhead)
> -		kfree(adapter->fhash.fhead);
> -
> +	kfree(adapter->fhash.fhead);

This changes how the code works.  That's very sloppy to not notice
that.  If you did notice it, it should be justified in the
changelog.  :(

>  	adapter->fhash.fhead = NULL;
>  	adapter->fhash.fmax = 0;
>  }

regards,
dan carpenter
--
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