]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: free iovec if file assignment fails
authorJens Axboe <axboe@kernel.dk>
Sun, 17 Apr 2022 03:14:00 +0000 (21:14 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 17 Apr 2022 03:14:00 +0000 (21:14 -0600)
commita1cc650ee56c286bd292ea292b3e4ee4b09b6f1f
tree4ca758039ff1ceda7c9b2aa8285c7e6eb9af6a6e
parent0875724c9d3f0623d3a8441e83e46f0af24d8269
io_uring: free iovec if file assignment fails

We just return failure in this case, but we need to release the iovec
first. If we're doing IO with more than FAST_IOV segments, then the
iovec is allocated and must be freed.

Reported-by: syzbot+96b43810dfe9c3bb95ed@syzkaller.appspotmail.com
Fixes: 2b76ab77d446 ("io_uring: move read/write file prep state into actual opcode handler")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c