Skip to content

Commit 4ec703e

Browse files
aloktiwaaxboe
authored andcommitted
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>
1 parent 18d6b17 commit 4ec703e

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
@@ -250,7 +250,7 @@ int io_waitid_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
250250
return -EINVAL;
251251

252252
iwa = io_uring_alloc_async_data(NULL, req);
253-
if (!unlikely(iwa))
253+
if (unlikely(!iwa))
254254
return -ENOMEM;
255255
iwa->req = req;
256256

0 commit comments

Comments
 (0)