Skip to content

Commit 4dfab8a

Browse files
isilenceaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/48cf5417b43a8386c6c364dba1ad9b4c7382d158.1655371007.git.asml.silence@gmail.com Reviewed-by: Hao Xu <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1ab1edb commit 4dfab8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

io_uring/cancel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ int io_try_cancel(struct io_kiocb *req, struct io_cancel_data *cd)
9595

9696
ret = io_poll_cancel(ctx, cd);
9797
if (ret != -ENOENT)
98-
goto out;
98+
return ret;
99+
99100
spin_lock(&ctx->completion_lock);
100101
if (!(cd->flags & IORING_ASYNC_CANCEL_FD))
101102
ret = io_timeout_cancel(ctx, cd);
102103
spin_unlock(&ctx->completion_lock);
103-
out:
104104
return ret;
105105
}
106106

0 commit comments

Comments
 (0)