aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/msg_ring.c
diff options
context:
space:
mode:
authorJens Axboe <[email protected]>2024-07-01 14:46:25 +0000
committerJens Axboe <[email protected]>2024-07-01 15:10:59 +0000
commitbe4f5d9c992ba1d89ce63ad9e40a99f120882038 (patch)
tree504a0290a3b554741382b99b8eeb2adf5069899b /io_uring/msg_ring.c
parentio_uring/msg_ring: check for dead submitter task (diff)
downloadkernel-be4f5d9c992ba1d89ce63ad9e40a99f120882038.tar.gz
kernel-be4f5d9c992ba1d89ce63ad9e40a99f120882038.zip
io_uring/msg_ring: use kmem_cache_free() to free request
The change adding caching around the request allocated and freed for data messages changed a kmem_cache_free() to a kfree(), which isn't correct as the request came from slab in the first place. Fix that up and use the right freeing function if the cache is already at its limit. Note that the current mixing of kmem_cache_alloc and kfree is fine, but consistent alloc/free functions should be used as it's otherwise somewhat confusing. Fixes: 50cf5f3842af ("io_uring/msg_ring: add an alloc cache for io_kiocb entries") Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'io_uring/msg_ring.c')
-rw-r--r--io_uring/msg_ring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c
index c2171495098b..29fa9285a33d 100644
--- a/io_uring/msg_ring.c
+++ b/io_uring/msg_ring.c
@@ -82,7 +82,7 @@ static void io_msg_tw_complete(struct io_kiocb *req, struct io_tw_state *ts)
spin_unlock(&ctx->msg_lock);
}
if (req)
- kfree(req);
+ kmem_cache_free(req_cachep, req);
percpu_ref_put(&ctx->refs);
}