Skip to content

Commit 1fd5367

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix types for region size calulation
->nr_pages is int, it needs type extension before calculating the region size. Fixes: a90558b ("io_uring/memmap: helper for pinning region pages") Signed-off-by: Pavel Begunkov <[email protected]> [axboe: style fixup] Signed-off-by: Jens Axboe <[email protected]>
1 parent 819630b commit 1fd5367

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/memmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int io_region_pin_pages(struct io_ring_ctx *ctx,
135135
struct io_mapped_region *mr,
136136
struct io_uring_region_desc *reg)
137137
{
138-
unsigned long size = mr->nr_pages << PAGE_SHIFT;
138+
unsigned long size = (size_t) mr->nr_pages << PAGE_SHIFT;
139139
struct page **pages;
140140
int nr_pages;
141141

0 commit comments

Comments
 (0)