From: Tsutomu Itoh Date: Fri, 19 Apr 2013 01:04:46 +0000 (+0000) Subject: Btrfs: fix error handling in btrfs_ioctl_send() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ecc7ada77b5cd1ac525db8f7d4d266e88af66cc7;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 158b91984b6..2037fc0efab 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; }