aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-17 01:10:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-17 08:23:03 -0400
commit0b44f7a5b5078d737b3f5914978aabb761254840 (patch)
tree7d726723f427a3add9a22ac4d34ca236b6f8376a /mm/slab.c
parent4b6f0750457db1f573eb6226960a432da3be8fe2 (diff)
slab: warn on zero-length allocations
slub warns on this, and we're working on making kmalloc(0) return NULL. Let's make slab warn as well so our testers detect such callers more rapidly. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 12344432e201..2043102c0425 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -789,6 +789,7 @@ static inline struct kmem_cache *__find_general_cachep(size_t size,
789 */ 789 */
790 BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); 790 BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL);
791#endif 791#endif
792 WARN_ON_ONCE(size == 0);
792 while (size > csizep->cs_size) 793 while (size > csizep->cs_size)
793 csizep++; 794 csizep++;
794 795