summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/zcrx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 6a983f1ab592..2d8bc4219463 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -194,8 +194,10 @@ static int io_import_umem(struct io_zcrx_ifq *ifq,
ret = sg_alloc_table_from_pages(&mem->page_sg_table, pages, nr_pages,
0, nr_pages << PAGE_SHIFT,
GFP_KERNEL_ACCOUNT);
- if (ret)
+ if (ret) {
+ unpin_user_pages(pages, nr_pages);
return ret;
+ }
mem->account_pages = io_count_account_pages(pages, nr_pages);
ret = io_account_mem(ifq->ctx, mem->account_pages);