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 @@ -112,8 +112,11 @@ static void io_release_ubuf(void *priv)
112
112
struct io_mapped_ubuf * imu = priv ;
113
113
unsigned int i ;
114
114
115
- for (i = 0 ; i < imu -> nr_bvecs ; i ++ )
116
- unpin_user_page (imu -> bvec [i ].bv_page );
115
+ for (i = 0 ; i < imu -> nr_bvecs ; i ++ ) {
116
+ struct folio * folio = page_folio (imu -> bvec [i ].bv_page );
117
+
118
+ unpin_user_folio (folio , 1 );
119
+ }
117
120
}
118
121
119
122
static struct io_mapped_ubuf * io_alloc_imu (struct io_ring_ctx * ctx ,
@@ -840,8 +843,10 @@ static struct io_rsrc_node *io_sqe_buffer_register(struct io_ring_ctx *ctx,
840
843
if (ret ) {
841
844
if (imu )
842
845
io_free_imu (ctx , imu );
843
- if (pages )
844
- unpin_user_pages (pages , nr_pages );
846
+ if (pages ) {
847
+ for (i = 0 ; i < nr_pages ; i ++ )
848
+ unpin_user_folio (page_folio (pages [i ]), 1 );
849
+ }
845
850
io_cache_free (& ctx -> node_cache , node );
846
851
node = ERR_PTR (ret );
847
852
}
You can’t perform that action at this time.
0 commit comments