Commit 19a8cc6c authored by Jackie Liu's avatar Jackie Liu Committed by Jens Axboe
Browse files

io_uring/rsrc: use io_cache_free() to free node



Replace kfree(node) with io_cache_free() in io_buffer_register_bvec()
to match all other error paths that free nodes allocated via
io_rsrc_node_alloc(). The node is allocated through io_cache_alloc()
internally, so it should be returned to the cache via io_cache_free()
for proper object reuse.

Signed-off-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Link: https://patch.msgid.link/20260331104509.7055-1-liu.yun@linux.dev


[axboe: remove fixes tag, it's not a fix, it's a cleanup]
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7c713dd0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -961,7 +961,7 @@ int io_buffer_register_bvec(struct io_uring_cmd *cmd, struct request *rq,
	 */
	imu = io_alloc_imu(ctx, blk_rq_nr_phys_segments(rq));
	if (!imu) {
		kfree(node);
		io_cache_free(&ctx->node_cache, node);
		ret = -ENOMEM;
		goto unlock;
	}