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

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
...@@ -4612,8 +4612,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) ...@@ -4612,8 +4612,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
sctx->flags = arg->flags; sctx->flags = arg->flags;
sctx->send_filp = fget(arg->send_fd); sctx->send_filp = fget(arg->send_fd);
if (IS_ERR(sctx->send_filp)) { if (!sctx->send_filp) {
ret = PTR_ERR(sctx->send_filp); ret = -EBADF;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment