Skip to content

Commit 021b153

Browse files
committed
io_uring/rsrc: clear 'slot' entry upfront
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]>
1 parent 84eacf1 commit 021b153

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/rsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ static void io_buffer_unmap(struct io_ring_ctx *ctx, struct io_mapped_ubuf **slo
114114
struct io_mapped_ubuf *imu = *slot;
115115
unsigned int i;
116116

117+
*slot = NULL;
117118
if (imu != &dummy_ubuf) {
118119
for (i = 0; i < imu->nr_bvecs; i++)
119120
unpin_user_page(imu->bvec[i].bv_page);
120121
if (imu->acct_pages)
121122
io_unaccount_mem(ctx, imu->acct_pages);
122123
kvfree(imu);
123124
}
124-
*slot = NULL;
125125
}
126126

127127
static void io_rsrc_put_work(struct io_rsrc_node *node)

0 commit comments

Comments
 (0)