aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/rsrc.c
diff options
context:
space:
mode:
authorCaleb Sander Mateos <[email protected]>2025-02-28 23:59:14 +0000
committerJens Axboe <[email protected]>2025-03-04 14:17:15 +0000
commitfe21a4532ef2a6852c89b352cb8ded0d37b4745c (patch)
treee5ef65203d49a4e1cdaeffbf82b0d0a996ab97f9 /io_uring/rsrc.c
parentio_uring/rsrc: avoid NULL node check on io_sqe_buffer_register() failure (diff)
downloadkernel-fe21a4532ef2a6852c89b352cb8ded0d37b4745c.tar.gz
kernel-fe21a4532ef2a6852c89b352cb8ded0d37b4745c.zip
io_uring/rsrc: skip NULL file/buffer checks in io_free_rsrc_node()
io_rsrc_node's of type IORING_RSRC_FILE always have a file attached immediately after they are allocated. IORING_RSRC_BUFFER nodes won't be returned from io_sqe_buffer_register()/io_buffer_register_bvec() until they have a io_mapped_ubuf attached. So remove the checks for a NULL file/buffer in io_free_rsrc_node(). Signed-off-by: Caleb Sander Mateos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r--io_uring/rsrc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 806f2c1f5d2e..3fb1bd616eef 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -500,12 +500,10 @@ void io_free_rsrc_node(struct io_ring_ctx *ctx, struct io_rsrc_node *node)
switch (node->type) {
case IORING_RSRC_FILE:
- if (io_slot_file(node))
- fput(io_slot_file(node));
+ fput(io_slot_file(node));
break;
case IORING_RSRC_BUFFER:
- if (node->buf)
- io_buffer_unmap(ctx, node->buf);
+ io_buffer_unmap(ctx, node->buf);
break;
default:
WARN_ON_ONCE(1);