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  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]
Date:	Sat, 23 Aug 2008 13:28:51 +0200
From:	Jim Meyering <>
To:	Marcel Holtmann <>
Subject: Re: [PATCH] ath9k: remove useless if-before-kfree; correct misleading indentation

Marcel Holtmann <> wrote:
>> >> Alternatively, you could remove the nowadays-useless
>> >> "if-before-kfree" test and leave the sometimes-redundant
>> >> assignment as-is: unconditional.
>> >
>> > actually the later one is preferred. Just remove the NULL check.
>> I prefer it, too, but the indentation suggested that
>> adding braces would match the author's intent.
>> In case anyone is interested, I have been maintaining a patch
>> that removes *all* useless if-before-kfree tests.  I have not
>> posted it because such changes have a reputation for provoking
>> flames on this list, but now you've provoked me ;-)
>>      74 files changed, 127 insertions(+), 250 deletions(-)
> I am all for this patch.
> Even the Glibc free() function will do an "if-before-free" :)

Hi Marcel,

Thanks for the support.

Yes, with glibc, free(NULL) is a no-op, and POSIX has required that
behavior for long enough that *all* implementations of free on reasonable
porting targets are NULL-safe these days.  There has been plenty of
discussion as I've helped a few projects clean up in this regard, e.g.,

Here are most of the projects that have endured this janitorial work:

There's even a tool to help ensure that no new useless if-before-kfree
tests sneak back in later.;a=blob_plain;f=build-aux/useless-if-before-free
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists