Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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 <segooon@gmail.com>
Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cc8e970c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;