summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/rsrc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 09a16d709cb5..e2bac9f89902 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -1235,7 +1235,13 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
}
}
if (folio) {
- folio_put_refs(folio, nr_pages - 1);
+ /*
+ * The pages are bound to the folio, it doesn't
+ * actually unpin them but drops all but one reference,
+ * which is usually put down by io_buffer_unmap().
+ * Note, needs a better helper.
+ */
+ unpin_user_pages(&pages[1], nr_pages - 1);
nr_pages = 1;
}
}