On Thu, 2011-10-06 at 14:28 -0500, Seth Jennings wrote: > > + if (kp->obj) { > + kmem_cache_free(zcache_obj_cache, kp->obj); > + kp->obj = NULL; > + } > + if (kp->page) { > + free_page((unsigned long)kp->page); > + kp->page = NULL; > + } Getting back from my preempt tangent... :) I'm not sure how free_page() can oops. If kp->page is NULL free_pages() will rescue you: void free_pages(unsigned long addr, unsigned int order) { if (addr != 0) { VM_BUG_ON(!virt_addr_valid((void *)addr)); __free_pages(virt_to_page((void *)addr), order); } } I *thought* we did some of the same for kmem_cache_free(), but maybe it's just kmalloc/kfree(). Anyway, it's all good. I don't like relying on the allocators to be nice when freeing NULL pointers anyway. Acked-by: Dave Hansen <dave@xxxxxxxxxxxxxxxxxx> -- Dave _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel