diff --git a/mm/slub.c b/mm/slub.c index 9acb413858ac532e9a668d4d2b351f4acdbd14c3..b9f37cb0f2e6a61d80eeca2b3c9dc3799e863bce 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2558,8 +2558,12 @@ size_t ksize(const void *object) if (unlikely(object == ZERO_SIZE_PTR)) return 0; - page = get_object_page(object); + page = virt_to_head_page(object); BUG_ON(!page); + + if (unlikely(!PageSlab(page))) + return PAGE_SIZE << compound_order(page); + s = page->slab; BUG_ON(!s);