Skip to content

Commit

Permalink
io_uring/rsrc: clear 'slot' entry upfront
Browse files Browse the repository at this point in the history
No functional changes in this patch, but clearing the slot pointer
earlier will be required by a later change.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Sep 11, 2024
1 parent 84eacf1 commit 021b153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_uring/rsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ static void io_buffer_unmap(struct io_ring_ctx *ctx, struct io_mapped_ubuf **slo
struct io_mapped_ubuf *imu = *slot;
unsigned int i;

*slot = NULL;
if (imu != &dummy_ubuf) {
for (i = 0; i < imu->nr_bvecs; i++)
unpin_user_page(imu->bvec[i].bv_page);
if (imu->acct_pages)
io_unaccount_mem(ctx, imu->acct_pages);
kvfree(imu);
}
*slot = NULL;
}

static void io_rsrc_put_work(struct io_rsrc_node *node)
Expand Down

0 comments on commit 021b153

Please sign in to comment.