io_uring: Fix leaked shadow_req
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 27 Oct 2019 19:10:36 +0000 (22:10 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2019 03:29:18 +0000 (21:29 -0600)
commit7b20238d28da46f394d37d4d51cc420e1ff9414a
tree94a5f93471b51d76560dfef1c66059d076f05394
parentd6d5df1db6e9d7f8f76d2911707f7d5877251b02
io_uring: Fix leaked shadow_req

io_queue_link_head() owns shadow_req after taking it as an argument.
By not freeing it in case of an error, it can leak the request along
with taken ctx->refs.

Reviewed-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c