Skip to content

Commit bcf5345

Browse files
committed
io_uring: fix incorrect unlikely() usage in io_waitid_prep()
JIRA: https://issues.redhat.com/browse/RHEL-105612 commit 4ec703e Author: Alok Tiwari <alok.a.tiwari@oracle.com> Date: Sat Oct 18 12:32:54 2025 -0700 io_uring: fix incorrect unlikely() usage in io_waitid_prep() The negation operator is incorrectly placed outside the unlikely() macro: if (!unlikely(iwa)) This inverts the compiler branch prediction hint, marking the NULL case as likely instead of unlikely. The intent is to indicate that allocation failures are rare, consistent with common kernel patterns. Moving the negation inside unlikely(): if (unlikely(!iwa)) Fixes: 2b4fc4c ("io_uring/waitid: setup async data in the prep handler") Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
1 parent 8235bf4 commit bcf5345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/waitid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int io_waitid_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
291291
return -EINVAL;
292292

293293
iwa = io_uring_alloc_async_data(NULL, req);
294-
if (!unlikely(iwa))
294+
if (unlikely(!iwa))
295295
return -ENOMEM;
296296
iwa->req = req;
297297

0 commit comments

Comments
 (0)