SLUB: It is legit to allocate a slab of the maximum permitted size
authorChristoph Lameter <clameter@sgi.com>
Wed, 16 May 2007 06:57:03 +0000 (23:57 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 17 May 2007 04:19:15 +0000 (21:19 -0700)
Sorry I screwed up the comparison. It is only an error if we attempt
to allocate a slab larger than the maximum allowed size.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/slub_def.h

index fd6627e2d11507bbc376be736cd9625098eb67df..c6c1f4a120e3a9f6ef6fd9caa2d7bb16580aa864 100644 (file)
@@ -88,7 +88,7 @@ static inline int kmalloc_index(int size)
         */
        WARN_ON_ONCE(size == 0);
 
-       if (size >= (1 << KMALLOC_SHIFT_HIGH))
+       if (size > (1 << KMALLOC_SHIFT_HIGH))
                return -1;
 
        if (size > 64 && size <= 96)