@@ -8489,7 +8489,7 @@ static int io_close_fixed(struct io_kiocb *req, unsigned int issue_flags)
84898489 struct io_ring_ctx * ctx = req -> ctx ;
84908490 struct io_fixed_file * file_slot ;
84918491 struct file * file ;
8492- int ret , i ;
8492+ int ret ;
84938493
84948494 io_ring_submit_lock (ctx , !(issue_flags & IO_URING_F_NONBLOCK ));
84958495 ret = - ENXIO ;
@@ -8502,8 +8502,8 @@ static int io_close_fixed(struct io_kiocb *req, unsigned int issue_flags)
85028502 if (ret )
85038503 goto out ;
85048504
8505- i = array_index_nospec (offset , ctx -> nr_user_files );
8506- file_slot = io_fixed_file_slot (& ctx -> file_table , i );
8505+ offset = array_index_nospec (offset , ctx -> nr_user_files );
8506+ file_slot = io_fixed_file_slot (& ctx -> file_table , offset );
85078507 ret = - EBADF ;
85088508 if (!file_slot -> file_ptr )
85098509 goto out ;
@@ -8559,8 +8559,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
85598559
85608560 if (file_slot -> file_ptr ) {
85618561 file = (struct file * )(file_slot -> file_ptr & FFS_MASK );
8562- err = io_queue_rsrc_removal (data , up -> offset + done ,
8563- ctx -> rsrc_node , file );
8562+ err = io_queue_rsrc_removal (data , i , ctx -> rsrc_node , file );
85648563 if (err )
85658564 break ;
85668565 file_slot -> file_ptr = 0 ;
@@ -9229,7 +9228,7 @@ static int __io_sqe_buffers_update(struct io_ring_ctx *ctx,
92299228
92309229 i = array_index_nospec (offset , ctx -> nr_user_bufs );
92319230 if (ctx -> user_bufs [i ] != ctx -> dummy_ubuf ) {
9232- err = io_queue_rsrc_removal (ctx -> buf_data , offset ,
9231+ err = io_queue_rsrc_removal (ctx -> buf_data , i ,
92339232 ctx -> rsrc_node , ctx -> user_bufs [i ]);
92349233 if (unlikely (err )) {
92359234 io_buffer_unmap (ctx , & imu );
0 commit comments