btrfs: handle kmalloc() failure
Subsystems (2)
PATCH 2/3 btrfs: handle kmalloc() failure
Return -ENOMEM if kmalloc() fails.
Signed-off-by Dan Carpenter <[email protected]>
fs/btrfs/ioctl.c +3 -0
@@ -1212,6 +1212,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 ;