Skip to content

Commit

Permalink
io_uring: ignore ->buf_index if REQ_F_BUFFER_SELECT isn't set
Browse files Browse the repository at this point in the history
There's no point in validity checking buf_index if the request doesn't
have REQ_F_BUFFER_SELECT set, as we will never use it for that case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed May 9, 2022
1 parent e5b0034 commit bb68d50
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3573,10 +3573,6 @@ static struct iovec *__io_import_iovec(int rw, struct io_kiocb *req,
return NULL;
}

/* buffer index only valid with fixed read/write, or buffer select */
if (unlikely(req->buf_index && !(req->flags & REQ_F_BUFFER_SELECT)))
return ERR_PTR(-EINVAL);

buf = u64_to_user_ptr(req->rw.addr);
sqe_len = req->rw.len;

Expand Down

0 comments on commit bb68d50

Please sign in to comment.