projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd6cba5
)
mm/sparse.c: check the return value of sparse_index_alloc()
author
WANG Cong
<
[email protected]
>
Tue, 18 Dec 2007 00:19:58 +0000
(16:19 -0800)
committer
Linus Torvalds
<
[email protected]
>
Tue, 18 Dec 2007 03:28:16 +0000
(19:28 -0800)
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
patch
|
blob
|
history
diff --git
a/mm/sparse.c
b/mm/sparse.c
index e06f514fe04faa748c5e50e3f4cb25789d977238..d245e59048a8ac115faf5fcacbccf505e5a5a347 100644
(file)
--- 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