summaryrefslogtreecommitdiffstats
path: root/io_uring/cancel.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-06-16 10:22:04 +0100
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:13 -0600
commit4dfab8abb4721da278a2ccd45c1b6a69f8a9dd14 (patch)
treed49720927907c8737bbad8189e3ca4da96716b2b /io_uring/cancel.c
parent1ab1edb0a104dd683d83e7853aa5b624856f4127 (diff)
downloadlinux-4dfab8abb4721da278a2ccd45c1b6a69f8a9dd14.tar.bz2
io_uring: clean up io_try_cancel
Get rid of an unnecessary extra goto in io_try_cancel() and simplify the function. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/48cf5417b43a8386c6c364dba1ad9b4c7382d158.1655371007.git.asml.silence@gmail.com Reviewed-by: Hao Xu <howeyxu@tencent.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/cancel.c')
-rw-r--r--io_uring/cancel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/cancel.c b/io_uring/cancel.c
index 6f2888388a40..a253e2ad22eb 100644
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -95,12 +95,12 @@ int io_try_cancel(struct io_kiocb *req, struct io_cancel_data *cd)
ret = io_poll_cancel(ctx, cd);
if (ret != -ENOENT)
- goto out;
+ return ret;
+
spin_lock(&ctx->completion_lock);
if (!(cd->flags & IORING_ASYNC_CANCEL_FD))
ret = io_timeout_cancel(ctx, cd);
spin_unlock(&ctx->completion_lock);
-out:
return ret;
}