File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,11 @@ static void io_buffer_unmap(struct io_ring_ctx *ctx, struct io_rsrc_node *node)
110110
111111 if (!refcount_dec_and_test (& imu -> refs ))
112112 return ;
113- for (i = 0 ; i < imu -> nr_bvecs ; i ++ )
114- unpin_user_page (imu -> bvec [i ].bv_page );
113+ for (i = 0 ; i < imu -> nr_bvecs ; i ++ ) {
114+ struct folio * folio = page_folio (imu -> bvec [i ].bv_page );
115+
116+ unpin_user_folio (folio , 1 );
117+ }
115118 if (imu -> acct_pages )
116119 io_unaccount_mem (ctx , imu -> acct_pages );
117120 kvfree (imu );
@@ -793,8 +796,10 @@ static struct io_rsrc_node *io_sqe_buffer_register(struct io_ring_ctx *ctx,
793796done :
794797 if (ret ) {
795798 kvfree (imu );
796- if (pages )
797- unpin_user_pages (pages , nr_pages );
799+ if (pages ) {
800+ for (i = 0 ; i < nr_pages ; i ++ )
801+ unpin_user_folio (page_folio (pages [i ]), 1 );
802+ }
798803 if (node )
799804 io_put_rsrc_node (ctx , node );
800805 node = ERR_PTR (ret );
You can’t perform that action at this time.
0 commit comments