Messages in this thread | | | Date | Wed, 21 Mar 2007 18:54:13 +0100 | From | Jörn Engel <> | Subject | Re: [PATCH] slab: deal with NULL pointers passed to kmem_cache_free |
| |
On Wed, 21 March 2007 08:30:27 -0800, Andrew Morton wrote: > On Wed, 21 Mar 2007 16:41:19 +0200 "Pekka Enberg" <penberg@cs.helsinki.fi> wrote: > > > Yeah, I'll try to sneak a patch past Andrew. > > That would be sneaky. > > Thing is, such a patch would amount to adding a test-for-NULL to codepaths > which we *know* do not need it. There is no point in doing that.
How about two patches, one renaming kmem_cache_free to kmem_cache_free_fast or __kmem_cache_free or whatever pleases you most, the second adding kmem_cache_free with a NULL check.
The point is that the easiest way to use kmem_cache_free should be the safest, but not necessarily the fastest. Existing well-tuned and NULL-aware code paths can remain fast, random new code will be safe.
Jörn
-- Joern's library part 14: http://www.sandpile.org/ - 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/
| |