Skip to contentSkip to conversation

mm/memblock.c:memblock_add_range(): if nr_new is 0 just return

PATCH New [email protected] 1 participant 1 message Jul 26, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 81/126 mm/memblock.c:memblock_add_range(): if nr_new is 0 just return

From: nimisolo <[email protected]>
Subject: 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.

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]>

---

 mm/memblock.c |    3 +++
 1 file changed, 3 insertions(+)
mm/memblock.c renamed from mm/memblock.c~mm-memblock-if-nr_new-is-0-just-return +3 -0
diff -puN mm/memblock.c~mm-memblock-if-nr_new-is-0-just-return mm/memblock.c
@@ -584,6 +584,9 @@ repeat:
 					       nid, flags);
 	}
 
+	if (!nr_new)
+		return 0;
+
 	/*
 	 * If this was the first round, resize array and repeat for actual
 	 * insertions; otherwise, merge and return.

_