Change the do { ... } while (--i); loop in set_slab_attr to a while (i--) { ... } loop like the rest of the functions that do similar loops in mm/slab.c. Index: linux-2.6.14+slab_cleanup/mm/slab.c =================================================================== --- linux-2.6.14+slab_cleanup.orig/mm/slab.c 2005-11-07 16:00:09.005539608 -0800 +++ linux-2.6.14+slab_cleanup/mm/slab.c 2005-11-07 16:07:59.169063888 -0800 @@ -2141,11 +2141,11 @@ static void set_slab_attr(kmem_cache_t * i = 1 << cachep->gfporder; page = virt_to_page(objp); - do { + while (i--) { SET_PAGE_CACHE(page, cachep); SET_PAGE_SLAB(page, slabp); page++; - } while (--i); + } } /*