mm/sparse.c: check the return value of sparse_index_alloc()

Since sparse_index_alloc() can return NULL on memory allocation failure,
we must deal with the failure condition when calling it.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

WANG Cong and committed by
Linus Torvalds
af0cd5a7 bd6cba53

+2
+2
mm/sparse.c
··· 83 83 return -EEXIST; 84 84 85 85 section = sparse_index_alloc(nid); 86 + if (!section) 87 + return -ENOMEM; 86 88 /* 87 89 * This lock keeps two different sections from 88 90 * reallocating for the same index