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:
cc8e970
)
mm/vmalloc.c: check kmalloc() return value
author
Kulikov Vasiliy
<
[email protected]
>
Tue, 10 Aug 2010 00:19:58 +0000
(17:19 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 10 Aug 2010 03:45:03 +0000
(20:45 -0700)
kmalloc() may fail, if so return -ENOMEM.
Signed-off-by: Kulikov Vasiliy <
[email protected]
>
Acked-by: Pekka Enberg <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/vmalloc.c
patch
|
blob
|
history
diff --git
a/mm/vmalloc.c
b/mm/vmalloc.c
index 8b5e4370540be67f1abcb2cc884a3ce82f46bf1a..918c51335d64165348dc3b54775019f7a78bcaa7 100644
(file)
--- a/
mm/vmalloc.c
+++ b/
mm/vmalloc.c
@@
-2437,8
+2437,11
@@
static int vmalloc_open(struct inode *inode, struct file *file)
unsigned int *ptr = NULL;
int ret;
- if (NUMA_BUILD)
+ if (NUMA_BUILD)
{
ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL);
+ if (ptr == NULL)
+ return -ENOMEM;
+ }
ret = seq_open(file, &vmalloc_op);
if (!ret) {
struct seq_file *m = file->private_data;