fget() returns NULL if error. So, we should check NULL or not.

Signed-off-by: Tsutomu Itoh <t-i...@jp.fujitsu.com>
---
 fs/btrfs/send.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 96a826a..f892e0e 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -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;
        }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to