diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-20 07:24:15 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-03-30 21:19:09 -0400 |
commit | c2b96929e2ca6914cf4a66cd8fe2a34c4a98277f (patch) | |
tree | acfc0f7c28305f2057e6eed88ffd8b34441ba2e1 /fs | |
parent | 683be16eb6e19a35aca2473668652259ed074094 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ioctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 874d36e5f167..74d89133f768 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1211,6 +1211,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file, | |||
1211 | return -EPERM; | 1211 | return -EPERM; |
1212 | 1212 | ||
1213 | args = kmalloc(sizeof(*args), GFP_KERNEL); | 1213 | args = kmalloc(sizeof(*args), GFP_KERNEL); |
1214 | if (!args) | ||
1215 | return -ENOMEM; | ||
1216 | |||
1214 | if (copy_from_user(args, argp, sizeof(*args))) { | 1217 | if (copy_from_user(args, argp, sizeof(*args))) { |
1215 | kfree(args); | 1218 | kfree(args); |
1216 | return -EFAULT; | 1219 | return -EFAULT; |