Skip to content

Commit

Permalink
io_uring: fix merge error in checking send/recv addr2 flags
Browse files Browse the repository at this point in the history
With the dropping of the IOPOLL checking in the per-opcode handlers,
we inadvertently left two checks in the recv/recvmsg and send/sendmsg
prep handlers for the same thing, and one of them includes addr2 which
holds the flags for these opcodes.

Fix it up and kill the redundant checks.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jun 21, 2022
1 parent 1bacd26 commit b60cac1
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 @@ -6077,8 +6077,6 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)

if (unlikely(sqe->file_index))
return -EINVAL;
if (unlikely(sqe->addr2 || sqe->file_index))
return -EINVAL;

sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
sr->len = READ_ONCE(sqe->len);
Expand Down Expand Up @@ -6315,8 +6313,6 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)

if (unlikely(sqe->file_index))
return -EINVAL;
if (unlikely(sqe->addr2 || sqe->file_index))
return -EINVAL;

sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
sr->len = READ_ONCE(sqe->len);
Expand Down

0 comments on commit b60cac1

Please sign in to comment.