Skip to content

Commit

Permalink
io_uring: kill extra iovec=NULL in import_iovec()
Browse files Browse the repository at this point in the history
If io_import_iovec() returns an error, return iovec is undefined and
must not be used, so don't set it to NULL when failing.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
isilence authored and axboe committed Aug 20, 2020
1 parent f261c16 commit 867a23e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2826,10 +2826,8 @@ static ssize_t __io_import_iovec(int rw, struct io_kiocb *req,
if (opcode == IORING_OP_READ || opcode == IORING_OP_WRITE) {
if (req->flags & REQ_F_BUFFER_SELECT) {
buf = io_rw_buffer_select(req, &sqe_len, needs_lock);
if (IS_ERR(buf)) {
*iovec = NULL;
if (IS_ERR(buf))
return PTR_ERR(buf);
}
req->rw.len = sqe_len;
}

Expand Down

0 comments on commit 867a23e

Please sign in to comment.