diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 7dc6aa745166..86897ee792d6 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -181,14 +181,13 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long fl } addr = ALIGN(start, align); size = PAGE_ALIGN(size); + if (unlikely(!size)) + return NULL; area = kmalloc_node(sizeof(*area), gfp_mask & GFP_LEVEL_MASK, node); if (unlikely(!area)) return NULL; - if (unlikely(!size)) - return NULL; - /* * We always allocate a guard page. */