summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-03-28 11:06:00 +0300
committerChris Mason <clm@fb.com>2014-04-07 09:08:44 -0700
commit84dbeb87d1439d3a6614c95e82429542434bafb9 (patch)
tree565df09d67424d796b3c321b579ff967885e4c1e /fs
parente9894fd3e3b3c5ecaa096d32c2d2b79db8e64433 (diff)
downloadlinux-84dbeb87d1439d3a6614c95e82429542434bafb9.tar.gz
linux-84dbeb87d1439d3a6614c95e82429542434bafb9.tar.bz2
linux-84dbeb87d1439d3a6614c95e82429542434bafb9.zip
Btrfs: kmalloc() doesn't return an ERR_PTR
The error handling was copy and pasted from memdup_user(). It should be checking for NULL obviously. Fixes: abccd00f8af2 ('btrfs: Fix 32/64-bit problem with BTRFS_SET_RECEIVED_SUBVOL ioctl') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ioctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6778fa3c6ed2..59622366c613 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4553,9 +4553,8 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file,
}
args64 = kmalloc(sizeof(*args64), GFP_NOFS);
- if (IS_ERR(args64)) {
- ret = PTR_ERR(args64);
- args64 = NULL;
+ if (!args64) {
+ ret = -ENOMEM;
goto out;
}