aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 16:21:34 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 16:21:34 -0400
commit9550b105b8646f916862aee3ab7b25020ca14159 (patch)
treed5e57db2bfd773611e2b77b4bbe6d89ba8449b45 /mm/slub.c
parenta5c96d8a1c67f31ef48935a78da2d2076513842b (diff)
slub: fix ksize() for zero-sized pointers
The slab and slob allocators already did this right, but slub would call "get_object_page()" on the magic ZERO_SIZE_PTR, with all kinds of nasty end results. Noted by Ingo Molnar. Cc: Ingo Molnar <mingo@elte.hu> Cc: Christoph Lameter <clameter@sgi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 52a4f44be394..322f3a5d72c7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2394,7 +2394,7 @@ size_t ksize(const void *object)
2394 struct page *page; 2394 struct page *page;
2395 struct kmem_cache *s; 2395 struct kmem_cache *s;
2396 2396
2397 if (object == ZERO_SIZE_PTR) 2397 if (ZERO_OR_NULL_PTR(object))
2398 return 0; 2398 return 0;
2399 2399
2400 page = get_object_page(object); 2400 page = get_object_page(object);