X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=io_uring%2Fcancel.c;h=a5d51471feebb189fcffcb0c9cb5118f216a6b31;hb=40701e0ea72e0e20e548e77d29302565c4c28c9e;hp=7b23607cf4afd9352ea2c9e9360b03b602b9879d;hpb=32904dec06adf350e04c2b2e6e6dbb321d852c6f;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/io_uring/cancel.c b/io_uring/cancel.c index 7b23607..a5d5147 100644 --- a/io_uring/cancel.c +++ b/io_uring/cancel.c @@ -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; }