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 <[email protected]>
Cc: Alexander Kuleshov <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Tang Chen <[email protected]>
Cc: Wei Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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.