[lkml]   [2006]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: kfree(NULL)
>> > I don't actually like kfree(NULL) any time except error paths. It is
>> > subjective, not crazy talk.
>> Documented interface is not subjective.
> That's great. I don't know quite how to reply, or even if I should
> if you don't read what I write.

Where's the problem, if a developer does not know whether an object is NULL
or not, he may call kfree(). If, on the other hand, he is sure it is NULL,
there is no need to refree it, and if he is sure it is non-NULL, he can
directly call __kfree(). So the readability can never suffer - you never
need an if(x==NULL) anymore.

Jan Engelhardt
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

 \ /
  Last update: 2006-04-22 22:23    [W:0.044 / U:11.168 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site