lkml.org 
[lkml]   [2004]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: PATCH, RFC: 2.6 Documentation/Codingstyle
From
Date
On Fri, 13 Feb 2004 19:38:21 EST, "Kevin O'Connor" said:

> 1 - kfree already checks for null, so checking for null before calling
> kfree is pointless.

As anybody who's chased a 'null pointer dereference' OOPS, plenty of
stuff in the kernel DOESN'T check for null. And this is a *style*
document, not a calling conventions document (unless we're documenting
the use of kmalloc/kfree as well as layout?

If we're doing that, we may well want to expand it slightly to cover
the case of 2 kmallocs, a 'goto out1' and 'goto out2' to demonstrate
proper unwinding/freeing....
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.152 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site