diff options
| author | WANG Cong <[email protected]> | 2007-12-18 00:19:58 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-12-18 03:28:16 +0000 |
| commit | af0cd5a7c3cded50c25e98acd94912d17a0eb914 (patch) | |
| tree | fcdf2cef80bb8846a8171333e78425abf0c3a326 /mm/sparse.c | |
| parent | cpufreq: fix missing unlocks in cpufreq_add_dev error paths. (diff) | |
| download | kernel-af0cd5a7c3cded50c25e98acd94912d17a0eb914.tar.gz kernel-af0cd5a7c3cded50c25e98acd94912d17a0eb914.zip | |
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]>
Diffstat (limited to 'mm/sparse.c')
| -rw-r--r-- | mm/sparse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index e06f514fe04f..d245e59048a8 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 |
