]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: fix incorrect unlikely() usage in io_waitid_prep()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Sat, 18 Oct 2025 19:32:54 +0000 (12:32 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 20 Oct 2025 15:22:09 +0000 (09:22 -0600)
commit4ec703ec0c384a2199808c4eb2e9037236285a8d
tree0886ce77ef0855c50198956f79200ac2d3306345
parent18d6b1743eafeb3fb1e0ea5a2b7fd0a773d525a8
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: 2b4fc4cd43f2 ("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>
io_uring/waitid.c