From ef3cc4db415e0cee73ea37ac6d79821d77f15f1d Mon Sep 17 00:00:00 2001 From: nimisolo Date: Tue, 26 Jul 2016 15:24:56 -0700 Subject: [PATCH] mm/memblock.c:memblock_add_range(): if nr_new is 0 just return If nr_new is 0 which means there's no region would be added, so just return to the caller. Signed-off-by: nimisolo Cc: Alexander Kuleshov Cc: Pekka Enberg Cc: Tony Luck Cc: Mel Gorman Cc: Tang Chen Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memblock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/memblock.c b/mm/memblock.c index ac1248933b31..ca099159b45a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -584,6 +584,9 @@ int __init_memblock memblock_add_range(struct memblock_type *type, nid, flags); } + if (!nr_new) + return 0; + /* * If this was the first round, resize array and repeat for actual * insertions; otherwise, merge and return. -- GitLab