提交 9550b105 编写于 作者: L Linus Torvalds

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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a5c96d8a
......@@ -2394,7 +2394,7 @@ size_t ksize(const void *object)
struct page *page;
struct kmem_cache *s;
if (object == ZERO_SIZE_PTR)
if (ZERO_OR_NULL_PTR(object))
return 0;
page = get_object_page(object);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册