diff options
author | 2024-03-13 15:01:03 -0600 | |
---|---|---|
committer | 2024-04-15 08:10:26 -0600 | |
commit | 18595c0a58ae29ac6a996c5b664610119b73182d (patch) | |
tree | 6add63bea7134e2584d1843b3fefbc49440e040e /io_uring/kbuf.c | |
parent | io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring (diff) | |
download | wireguard-linux-18595c0a58ae29ac6a996c5b664610119b73182d.tar.xz wireguard-linux-18595c0a58ae29ac6a996c5b664610119b73182d.zip |
io_uring: use unpin_user_pages() where appropriate
There are a few cases of open-rolled loops around unpin_user_page(), use
the generic helper instead.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | io_uring/kbuf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 820ac599d003..10d5c98c1c56 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -455,8 +455,8 @@ static int io_pin_pbuf_ring(struct io_uring_buf_reg *reg, struct io_buffer_list *bl) { struct io_uring_buf_ring *br = NULL; - int nr_pages, ret, i; struct page **pages; + int nr_pages, ret; pages = io_pin_pages(reg->ring_addr, flex_array_size(br, bufs, reg->ring_entries), @@ -492,8 +492,7 @@ static int io_pin_pbuf_ring(struct io_uring_buf_reg *reg, bl->is_mmap = 0; return 0; error_unpin: - for (i = 0; i < nr_pages; i++) - unpin_user_page(pages[i]); + unpin_user_pages(pages, nr_pages); kvfree(pages); vunmap(br); return ret; |