Skip to content

Commit ecc7ada

Browse files
Tsutomu ItohJosef Bacik
authored andcommitted
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>
1 parent ba1eeaa commit ecc7ada

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/btrfs/send.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4612,8 +4612,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
46124612
sctx->flags = arg->flags;
46134613

46144614
sctx->send_filp = fget(arg->send_fd);
4615-
if (IS_ERR(sctx->send_filp)) {
4616-
ret = PTR_ERR(sctx->send_filp);
4615+
if (!sctx->send_filp) {
4616+
ret = -EBADF;
46174617
goto out;
46184618
}
46194619

0 commit comments

Comments
 (0)