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

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
......@@ -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;
......
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