mm/vmalloc.c: check kmalloc() return value
[pandora-kernel.git] / mm / vmalloc.c
index 8b5e437..918c513 100644 (file)
@@ -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;