Skip to content

Commit

Permalink
mm/memblock.c:memblock_add_range(): if nr_new is 0 just return
Browse files Browse the repository at this point in the history
If nr_new is 0 which means there's no region would be added, so just
return to the caller.

Signed-off-by: nimisolo <nimisolo@gmail.com>
Cc: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
nimisolo authored and torvalds committed Jul 26, 2016
1 parent 8a5c743 commit ef3cc4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/memblock.c
Expand Up @@ -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.
Expand Down

0 comments on commit ef3cc4d

Please sign in to comment.