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]
Date:	Thu, 24 Apr 2014 10:03:44 -0500
From:	Felipe Balbi <balbi@...com>
To:	Chanwoo Choi <cwchoi00@...il.com>
CC:	Felipe Balbi <balbi@...com>, Chanwoo Choi <cw00.choi@...sung.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>,
	<gg@...mlogic.co.uk>, Kishon Vijay Abraham I <kishon@...com>,
	<ckeepax@...nsource.wolfsonmicro.com>,
	Mark Brown <broonie@...nel.org>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCHv3 1/9] extcon: Add extcon_dev_allocate/free() to control
 the memory of extcon device

Hi,

On Thu, Apr 24, 2014 at 11:58:29PM +0900, Chanwoo Choi wrote:
> >> +void extcon_dev_free(struct extcon_dev *edev)
> >> +{
> >> +     if (edev)
> >> +             kfree(edev);
> >
> > kfree(NULL) is safe
> 
> I don't understand about meaning 'kfree(NULL)'.
> Why do I free 'NULL' pointer' instead of 'edev' pointer?

you don't need to check if evdev is valid before calling kfree() on it
because if it happens to be NULL, no cute bunnies will be sacrificed.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ