diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2558,8 +2558,12 @@ size_t ksize(const void *object) | |||
2558 | if (unlikely(object == ZERO_SIZE_PTR)) | 2558 | if (unlikely(object == ZERO_SIZE_PTR)) |
2559 | return 0; | 2559 | return 0; |
2560 | 2560 | ||
2561 | page = get_object_page(object); | 2561 | page = virt_to_head_page(object); |
2562 | BUG_ON(!page); | 2562 | BUG_ON(!page); |
2563 | |||
2564 | if (unlikely(!PageSlab(page))) | ||
2565 | return PAGE_SIZE << compound_order(page); | ||
2566 | |||
2563 | s = page->slab; | 2567 | s = page->slab; |
2564 | BUG_ON(!s); | 2568 | BUG_ON(!s); |
2565 | 2569 | ||