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: abccd00f8a ('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>
This commit is contained in:
Dan Carpenter 2014-03-28 11:06:00 +03:00 committed by Chris Mason
parent e9894fd3e3
commit 84dbeb87d1
1 changed files with 2 additions and 3 deletions

View File

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