6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe <axboe@xxxxxxxxx> Commit 18595c0a58ae29ac6a996c5b664610119b73182d upstream. There are a few cases of open-rolled loops around unpin_user_page(), use the generic helper instead. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/kbuf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -458,8 +458,8 @@ static int io_pin_pbuf_ring(struct io_ur 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), @@ -495,8 +495,7 @@ static int io_pin_pbuf_ring(struct io_ur 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;