summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorTsutomu Itoh2013-04-19 03:04:46 +0200
committerJosef Bacik2013-05-06 21:55:13 +0200
commitecc7ada77b5cd1ac525db8f7d4d266e88af66cc7 (patch)
treeb1fbf177d840bd2167d2c3cb50b9e05e4fc8c268 /fs/btrfs/send.c
parentBtrfs: remove unused variable in __process_changed_new_xattr() (diff)
downloadkernel-qcow2-linux-ecc7ada77b5cd1ac525db8f7d4d266e88af66cc7.tar.gz
kernel-qcow2-linux-ecc7ada77b5cd1ac525db8f7d4d266e88af66cc7.tar.xz
kernel-qcow2-linux-ecc7ada77b5cd1ac525db8f7d4d266e88af66cc7.zip
Btrfs: fix error handling in btrfs_ioctl_send()
fget() returns NULL if error. So, we should check NULL or not. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 158b91984b60..2037fc0efab1 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -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;
}