Skip to contentSkip to conversation

mm/memblock: If nr_new is 0 just return

PATCH In review nimisolo 2 participants 2 messages Jan 9, 2016 – Jan 12, 2016

Subsystems (2)
lore
Share & tools
lore

nimisolo

author
#0 lore raw

PATCH 1/1 mm/memblock: 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.

---
 mm/memblock.c | 3 +++
 1 file changed, 3 insertions(+)
mm/memblock.c +3 -0
index d300f13..9a30077 100644
@@ -588,6 +588,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.
Signature · 7 lines
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 8 lines · On Sat, 9 Jan 2016 06:33:40 -0500 nimisolo <[email protected]> wrote:

If nr_new is 0 which means there's no region would be added, so just return to the caller.

...

mm/memblock.c repeat: · line 596

Quoted 9 lines
mm/memblock.c +3 -0
@@ -588,6 +588,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.

hm, why? Is there something actually wrong with the current code?

Under what circumstances does nr_new==0 actually happen? Is it a bug in the caller?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>