Messages in this thread | | | Date | Sat, 22 Apr 2006 22:18:36 +0200 (MEST) | From | Jan Engelhardt <> | Subject | Re: 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |