linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memblock: check memblock_reserve on fail in memblock_virt_alloc_internal
@ 2015-08-15 18:26 Alexander Kuleshov
  2015-08-17 21:59 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kuleshov @ 2015-08-15 18:26 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Tony Luck, Pekka Enberg, Mel Gorman, Robin Holt, Tang Chen,
	linux-mm, linux-kernel, Alexander Kuleshov

This patch adds a check for memblock_reserve() call in the
memblock_virt_alloc_internal() function, because memblock_reserve()
can return -errno on fail.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 mm/memblock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 87108e7..73427546 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1298,7 +1298,9 @@ again:
 
 	return NULL;
 done:
-	memblock_reserve(alloc, size);
+	if (memblock_reserve(alloc, size))
+		return NULL;
+
 	ptr = phys_to_virt(alloc);
 	memset(ptr, 0, size);
 
-- 
2.5.0

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-17 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-15 18:26 [PATCH] mm/memblock: check memblock_reserve on fail in memblock_virt_alloc_internal Alexander Kuleshov
2015-08-17 21:59 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox