Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=af0cd5a7c3cded50c25e98acd94912d17a0eb914 Commit: af0cd5a7c3cded50c25e98acd94912d17a0eb914 Parent: bd6cba53c524dccf72900435d29722b22f61d835 Author: WANG Cong <[EMAIL PROTECTED]> AuthorDate: Mon Dec 17 16:19:58 2007 -0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Mon Dec 17 19:28:16 2007 -0800
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 <[EMAIL PROTECTED]> Cc: Christoph Lameter <[EMAIL PROTECTED]> Cc: Rik van Riel <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- mm/sparse.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index e06f514..d245e59 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -83,6 +83,8 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid) return -EEXIST; section = sparse_index_alloc(nid); + if (!section) + return -ENOMEM; /* * This lock keeps two different sections from * reallocating for the same index - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html