diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 16:17:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 16:17:15 -0400 |
commit | a5c96d8a1c67f31ef48935a78da2d2076513842b (patch) | |
tree | d164c6b33a1de9ea157b99bb353f84e41774164e | |
parent | ce8c2293be47999584908069e78bf6d94beadc53 (diff) |
Fix up non-NUMA SLAB configuration for zero-sized allocations
I suspect Christoph tested his code only in the NUMA configuration, for
the combination of SLAB+non-NUMA the zero-sized kmalloc's would not work.
Of course, this would only trigger in configurations where those zero-
sized allocations happen (not very common), so that may explain why it
wasn't more widely noticed.
Seen by by Andi Kleen under qemu, and there seems to be a report by
Michael Tsirkin on it too.
Cc: Andi Kleen <ak@suse.de>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/slab.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3690,8 +3690,8 @@ static __always_inline void *__do_kmalloc(size_t size, gfp_t flags, | |||
3690 | * functions. | 3690 | * functions. |
3691 | */ | 3691 | */ |
3692 | cachep = __find_general_cachep(size, flags); | 3692 | cachep = __find_general_cachep(size, flags); |
3693 | if (unlikely(cachep == NULL)) | 3693 | if (unlikely(ZERO_OR_NULL_PTR(cachep))) |
3694 | return NULL; | 3694 | return cachep; |
3695 | return __cache_alloc(cachep, flags, caller); | 3695 | return __cache_alloc(cachep, flags, caller); |
3696 | } | 3696 | } |
3697 | 3697 | ||