aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-05-13 18:26:49 +0100
committerJens Axboe <axboe@kernel.dk>2025-05-13 14:45:55 -0600
commit52a05d0cf8f3b4569c525153132a90661c32fe11 (patch)
treed665f4e4b950731dba26d26b444f5936d5a6595b
parentio_uring/kbuf: drop extra vars in io_register_pbuf_ring (diff)
downloadwireguard-linux-52a05d0cf8f3b4569c525153132a90661c32fe11.tar.xz
wireguard-linux-52a05d0cf8f3b4569c525153132a90661c32fe11.zip
io_uring/kbuf: don't compute size twice on prep
The size in prep is calculated by io_provide_buffers_prep(), so remove the recomputation a few lines after. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/7c97206561b74fce245cb22449c6082d2e066844.1747150490.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/kbuf.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 406e8a9b42c3..eb666c02f488 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -509,8 +509,6 @@ int io_provide_buffers_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
return -EOVERFLOW;
if (check_add_overflow((unsigned long)p->addr, size, &tmp_check))
return -EOVERFLOW;
-
- size = (unsigned long)p->len * p->nbufs;
if (!access_ok(u64_to_user_ptr(p->addr), size))
return -EFAULT;