Skip to contentSkip to conversation

io_uring: Fix incorrect ordering of assinments of sqe and opcode

PATCH In review Colin Ian King 2 participants 2 messages Oct 22, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: Fix incorrect ordering of assinments of sqe and opcode

Currently opcode is being assigned to a dereferenced pointer sqe before sqe is being assigned. It appears the order of these two assignments cs the wrong way around. Fix this by swapping the order of the assignments.

Fixes 31dc41afdef2 ("io_uring: add support for IORING_SETUP_SQE_MIXED")
---
 io_uring/fdinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/fdinfo.c +1 -1
index d5aa64203de5..5b26b2a97e1b 100644
@@ -100,8 +100,8 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
 		if (sq_idx > sq_mask)
 			continue;
 
-		opcode = READ_ONCE(sqe->opcode);
 		sqe = &ctx->sq_sqes[sq_idx << sq_shift];
+		opcode = READ_ONCE(sqe->opcode);
 		if (sq_shift) {
 			sqe128 = true;
 		} else if (io_issue_defs[opcode].is_128) {
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 3 lines · Colin Ian King

Currently opcode is being assigned to a dereferenced pointer sqe before sqe is being assigned. It appears the order of these two assignments cs the wrong way around. Fix this by swapping the order of the assignments.

Fix for this has already been folded in.

Signature · 1 line
Jens Axboe