From 7f03a3c0446eafe31ed013cfda554e988a155965 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 21 Jul 2012 10:53:54 +1000 Subject: [PATCH] mm-make-vb_alloc-more-foolproof-fix use WARN_ON-return-value feature Cc: Jan Kara Signed-off-by: Andrew Morton --- mm/vmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 1f769b0aac1a..2bb90b1d241c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -904,13 +904,12 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) BUG_ON(size & ~PAGE_MASK); BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); - if (size == 0) { + if (WARN_ON(size == 0)) { /* * Allocating 0 bytes isn't what caller wants since * get_order(0) returns funny result. Just warn and terminate * early. */ - WARN_ON(1); return NULL; } order = get_order(size); -- 2.39.5