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

Commit ecc7ada7 authored by Tsutomu Itoh's avatar Tsutomu Itoh Committed by Josef Bacik
Browse files

Btrfs: fix error handling in btrfs_ioctl_send()



fget() returns NULL if error. So, we should check NULL or not.

Signed-off-by: default avatarTsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent ba1eeaac
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4612,8 +4612,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
	sctx->flags = arg->flags;

	sctx->send_filp = fget(arg->send_fd);
	if (IS_ERR(sctx->send_filp)) {
		ret = PTR_ERR(sctx->send_filp);
	if (!sctx->send_filp) {
		ret = -EBADF;
		goto out;
	}