Messages in this thread | | | Date | Wed, 21 Mar 2007 14:13:52 +0200 | From | "Pekka Enberg" <> | Subject | Re: [PATCH] slab: deal with NULL pointers passed to kmem_cache_free |
| |
On 3/21/07, Jarek Poplawski <jarkao2@o2.pl> wrote: > I think Pekka was right (it looks he changed his mind now) something > should be done here. I think something like this should be a minimum: > > BUG_ON(!objp || virt_to_cache(objp) != cachep); > > to show distinctly what's going on.
No, if we were to add a NULL check in kmem_cache_free(), it should behave like kfree() does. Anyway, if you feel about this strongly I suspect the best solution is to add a __kmem_cache_free which does _not_ have the NULL check and convert those super-hot paths to use it. Sort of what Andrew suggested already. - 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/
| |