]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/kbuf: don't compute size twice on prep
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 13 May 2025 17:26:49 +0000 (18:26 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 May 2025 20:45:55 +0000 (14:45 -0600)
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>
io_uring/kbuf.c

index 406e8a9b42c3f983f58ec3c8a0d3a3258ce2da98..eb666c02f488fba9b38bafe0a5daac3084a52afc 100644 (file)
@@ -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;