[lkml]   [2007]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] slab: deal with NULL pointers passed to kmem_cache_free

On Mon, 19 Mar 2007, Andrew Morton wrote:
> err, we don't want to do this, do we? It adds overhead for something which
> we've carefully taught all our programmers to not do. The only known code
> which will benefit from this is buggy.

Well, I actually disagree with that. It makes little sense for
kmem_cache_free() to behave differently from kfree() especially since the
overhead is minimal. But anyway, if you're unhappy with the patch, then we
should make it explicit that you're not allowed to pass NULL to
kmem_cache_free(), mempool_free() and perhaps others as well in which case
kfree() comes even more special...

I know this has been discussed in the past but I think you should be able
to blindly pass whetever pointer the allocator fuction gives you to the
corresponding release function which is why I wanted to fix
kmem_cache_free() in the first place.

On Mon, 19 Mar 2007, Andrew Morton wrote:
> s/fix/hide/

No, even though there is clearly some problem with either the scsi or
block layer not allocating any pages for the iovec, I do think slab should
deal with NULL pointers properly.

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: 2007-03-19 12:43    [W:0.162 / U:3.536 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site