Commit 51980ac9 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Linus Torvalds
Browse files

mm/vmalloc.c: check kmalloc() return value

kmalloc() may fail, if so return -ENOMEM.
Signed-off-by: default avatarKulikov Vasiliy <>
Acked-by: default avatarPekka Enberg <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent cc8e970c
......@@ -2437,8 +2437,11 @@ static int vmalloc_open(struct inode *inode, struct file *file)
unsigned int *ptr = NULL;
int ret;
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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment