]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix error handling for io_uring_cmd
authorAnuj Gupta <anuj20.g@samsung.com>
Thu, 11 Aug 2022 09:14:59 +0000 (14:44 +0530)
committerJens Axboe <axboe@kernel.dk>
Thu, 11 Aug 2022 16:56:00 +0000 (10:56 -0600)
commit91007f210464dadaa47ca4711901dfcc8ea98c2f
treeb392784a2ec0009fb964eef6a928fc039446afa7
parente521b0abdb94d01b4ca991d401b995a7b91fa42b
io_uring: fix error handling for io_uring_cmd

Commit 1efbdb3a123b ("io_uring: handle completions in the core") moved the
error handling from handler to core. But for io_uring_cmd handler we end
up completing more than once (both in handler and in core) leading to
use_after_free.
Change io_uring_cmd handler to avoid calling io_uring_cmd_done in case
of error.

Fixes: 1efbdb3a123b ("io_uring: handle completions in the core")
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20220811091459.6929-1-anuj20.g@samsung.com
[axboe: fix ret vs req typo]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/uring_cmd.c