Btrfs: fix error handling in btrfs_ioctl_send()
PATCH 1/1 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 <[email protected]>
--- fs/btrfs/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/send.c +2 -2
@@ -4610,8 +4610,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; }