Bluetooth: Cancel the Sniff timer
[platform/kernel/linux-starfive.git] / io_uring / cancel.c
index 7b23607..a5d5147 100644 (file)
@@ -263,7 +263,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;
 
@@ -285,10 +285,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);
@@ -338,6 +338,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;
 }