mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a5c96d8a1c
commit
9550b105b8
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue