[PATCH 5/5] mm/sparse: return 0 if root mem_section exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Function sparse_index_init() is used to setup memory section descriptors
dynamically. zero should be returned while mem_section[root] already has
been allocated.

Signed-off-by: Gavin Shan <shangw@xxxxxxxxxxxxxxxxxx>
---
 mm/sparse.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index a8b99d3..e845a48 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -109,8 +109,12 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
 	struct mem_section *section;
 	int ret = 0;
 
+	/*
+	 * If the corresponding mem_section descriptor
+	 * has been created, we needn't bother
+	 */
 	if (mem_section[root])
-		return -EEXIST;
+		return ret;
 
 	section = sparse_index_alloc(nid);
 	if (!section)
-- 
1.7.9.5

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]