mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
Btrfs: handle kmalloc() failure in inode lookup ioctl
Return -ENOMEM if kmalloc() fails. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
683be16eb6
commit
c2b96929e2
1 changed files with 3 additions and 0 deletions
|
@ -1211,6 +1211,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
args = kmalloc(sizeof(*args), GFP_KERNEL);
|
args = kmalloc(sizeof(*args), GFP_KERNEL);
|
||||||
|
if (!args)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
if (copy_from_user(args, argp, sizeof(*args))) {
|
if (copy_from_user(args, argp, sizeof(*args))) {
|
||||||
kfree(args);
|
kfree(args);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue