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

Commit c2b96929 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason
Browse files

Btrfs: handle kmalloc() failure in inode lookup ioctl



Return -ENOMEM if kmalloc() fails.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 683be16e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1211,6 +1211,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
		return -EPERM;

	args = kmalloc(sizeof(*args), GFP_KERNEL);
	if (!args)
		return -ENOMEM;

	if (copy_from_user(args, argp, sizeof(*args))) {
		kfree(args);
		return -EFAULT;