Merge tag 'sound-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / io_uring / cancel.c
index 3c19ccc..8a8b07d 100644 (file)
@@ -273,7 +273,7 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg)
        };
        ktime_t timeout = KTIME_MAX;
        struct io_uring_sync_cancel_reg sc;
-       struct fd f = { };
+       struct file *file = NULL;
        DEFINE_WAIT(wait);
        int ret, i;
 
@@ -295,10 +295,10 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg)
        /* we can grab a normal file descriptor upfront */
        if ((cd.flags & IORING_ASYNC_CANCEL_FD) &&
           !(cd.flags & IORING_ASYNC_CANCEL_FD_FIXED)) {
-               f = fdget(sc.fd);
-               if (!f.file)
+               file = fget(sc.fd);
+               if (!file)
                        return -EBADF;
-               cd.file = f.file;
+               cd.file = file;
        }
 
        ret = __io_sync_cancel(current->io_uring, &cd, sc.fd);
@@ -348,6 +348,7 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg)
        if (ret == -ENOENT || ret > 0)
                ret = 0;
 out:
-       fdput(f);
+       if (file)
+               fput(file);
        return ret;
 }