public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH io_uring-6.18 1/1] io_uring: fix types for region size calulation
@ 2025-11-05 15:47 Pavel Begunkov
  2025-11-05 18:44 ` Jens Axboe
  2025-11-05 18:45 ` Jens Axboe
  0 siblings, 2 replies; 5+ messages in thread
From: Pavel Begunkov @ 2025-11-05 15:47 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

->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>
---
 io_uring/memmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/memmap.c b/io_uring/memmap.c
index 2e99dffddfc5..fab79c7b3157 100644
--- a/io_uring/memmap.c
+++ b/io_uring/memmap.c
@@ -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;
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-06 23:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 15:47 [PATCH io_uring-6.18 1/1] io_uring: fix types for region size calulation Pavel Begunkov
2025-11-05 18:44 ` Jens Axboe
2025-11-06 12:09   ` Pavel Begunkov
2025-11-06 23:23     ` Jens Axboe
2025-11-05 18:45 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox