]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: fix types for region size calulation
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 5 Nov 2025 15:47:01 +0000 (15:47 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Nov 2025 18:45:07 +0000 (11:45 -0700)
->nr_pages is int, it needs type extension before calculating the region
size.

Fixes: a90558b36ccee ("io_uring/memmap: helper for pinning region pages")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: style fixup]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/memmap.c

index 2e99dffddfc5cce848c2929753e266a58de5c37f..add03ca75cb90eb4040916b69731e40855a12da8 100644 (file)
@@ -135,7 +135,7 @@ static int io_region_pin_pages(struct io_ring_ctx *ctx,
                                struct io_mapped_region *mr,
                                struct io_uring_region_desc *reg)
 {
-       unsigned long size = mr->nr_pages << PAGE_SHIFT;
+       unsigned long size = (size_t) mr->nr_pages << PAGE_SHIFT;
        struct page **pages;
        int nr_pages;