Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84dbeb87 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason
Browse files

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: abccd00f ('btrfs: Fix 32/64-bit problem with BTRFS_SET_RECEIVED_SUBVOL ioctl')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent e9894fd3
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -4553,9 +4553,8 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file,
	}
	}


	args64 = kmalloc(sizeof(*args64), GFP_NOFS);
	args64 = kmalloc(sizeof(*args64), GFP_NOFS);
	if (IS_ERR(args64)) {
	if (!args64) {
		ret = PTR_ERR(args64);
		ret = -ENOMEM;
		args64 = NULL;
		goto out;
		goto out;
	}
	}