Skip to content

Commit 867a23e

Browse files
isilenceaxboe
authored andcommitted
io_uring: kill extra iovec=NULL in import_iovec()
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>
1 parent f261c16 commit 867a23e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/io_uring.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,10 +2826,8 @@ static ssize_t __io_import_iovec(int rw, struct io_kiocb *req,
28262826
if (opcode == IORING_OP_READ || opcode == IORING_OP_WRITE) {
28272827
if (req->flags & REQ_F_BUFFER_SELECT) {
28282828
buf = io_rw_buffer_select(req, &sqe_len, needs_lock);
2829-
if (IS_ERR(buf)) {
2830-
*iovec = NULL;
2829+
if (IS_ERR(buf))
28312830
return PTR_ERR(buf);
2832-
}
28332831
req->rw.len = sqe_len;
28342832
}
28352833

0 commit comments

Comments
 (0)