diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-09-11 22:52:17 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-09-11 22:52:17 +0300 |
commit | 021b153f7d4115d99efa0d57ae2da6de1228295d (patch) | |
tree | 7b9d9bf533e89781e51fd7cc2002b312e0517f45 | |
parent | 84eacf177faa605853c58e5b1c0d9544b88c16fd (diff) | |
download | linux-021b153f7d4115d99efa0d57ae2da6de1228295d.tar.xz |
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 <axboe@kernel.dk>
-rw-r--r-- | io_uring/rsrc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 7d639a996f28..d42114845fac 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -114,6 +114,7 @@ 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); @@ -121,7 +122,6 @@ static void io_buffer_unmap(struct io_ring_ctx *ctx, struct io_mapped_ubuf **slo io_unaccount_mem(ctx, imu->acct_pages); kvfree(imu); } - *slot = NULL; } static void io_rsrc_put_work(struct io_rsrc_node *node) |