diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-26 13:21:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-26 13:21:26 -0400 |
commit | 1434b65731963207a4cc84bd87e6191e34321986 (patch) | |
tree | 07f58551b451675c2f85ebe88e5feb8971577d78 /mm | |
parent | 4934ed888e6fe78d9d339471fb870819da911e8b (diff) | |
parent | 76994412f8e824e79a593d6777ec327d85f942b2 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
slub: ksize() abuse checks
slob: Fix to return wrong pointer
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slob.c | 5 | ||||
-rw-r--r-- | mm/slub.c | 5 |
2 files changed, 6 insertions, 4 deletions
@@ -469,8 +469,9 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) | |||
469 | return ZERO_SIZE_PTR; | 469 | return ZERO_SIZE_PTR; |
470 | 470 | ||
471 | m = slob_alloc(size + align, gfp, align, node); | 471 | m = slob_alloc(size + align, gfp, align, node); |
472 | if (m) | 472 | if (!m) |
473 | *m = size; | 473 | return NULL; |
474 | *m = size; | ||
474 | return (void *)m + align; | 475 | return (void *)m + align; |
475 | } else { | 476 | } else { |
476 | void *ret; | 477 | void *ret; |
@@ -2726,9 +2726,10 @@ size_t ksize(const void *object) | |||
2726 | 2726 | ||
2727 | page = virt_to_head_page(object); | 2727 | page = virt_to_head_page(object); |
2728 | 2728 | ||
2729 | if (unlikely(!PageSlab(page))) | 2729 | if (unlikely(!PageSlab(page))) { |
2730 | WARN_ON(!PageCompound(page)); | ||
2730 | return PAGE_SIZE << compound_order(page); | 2731 | return PAGE_SIZE << compound_order(page); |
2731 | 2732 | } | |
2732 | s = page->slab; | 2733 | s = page->slab; |
2733 | 2734 | ||
2734 | #ifdef CONFIG_SLUB_DEBUG | 2735 | #ifdef CONFIG_SLUB_DEBUG |