Commit 2b350f75 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring/net: clean io_msg_copy_hdr()



Put msg->msg_iov into a local variable in io_msg_copy_hdr(), it reads
better and clearly shows the used types.

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Reviewed-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/6a5d4f7a96b10e571d6128be010166b3aaf7afd5.1738087204.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent fefcb0dc
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -280,11 +280,12 @@ static int io_msg_copy_hdr(struct io_kiocb *req, struct io_async_msghdr *iomsg,
			ret = -EINVAL;
			goto ua_end;
		} else {
			struct iovec __user *uiov = msg->msg_iov;

			/* we only need the length for provided buffers */
			if (!access_ok(&msg->msg_iov[0].iov_len, sizeof(__kernel_size_t)))
			if (!access_ok(&uiov->iov_len, sizeof(uiov->iov_len)))
				goto ua_end;
			unsafe_get_user(iov->iov_len, &msg->msg_iov[0].iov_len,
					ua_end);
			unsafe_get_user(iov->iov_len, &uiov->iov_len, ua_end);
			sr->len = iov->iov_len;
		}
		ret = 0;