summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlok Tiwari <alok.a.tiwari@oracle.com>2025-10-18 12:32:54 -0700
committerJens Axboe <axboe@kernel.dk>2025-10-20 09:22:09 -0600
commit4ec703ec0c384a2199808c4eb2e9037236285a8d (patch)
tree0886ce77ef0855c50198956f79200ac2d3306345
parent18d6b1743eafeb3fb1e0ea5a2b7fd0a773d525a8 (diff)
downloadlinux-4ec703ec0c384a2199808c4eb2e9037236285a8d.tar.gz
linux-4ec703ec0c384a2199808c4eb2e9037236285a8d.tar.bz2
linux-4ec703ec0c384a2199808c4eb2e9037236285a8d.zip
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>
-rw-r--r--io_uring/waitid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/waitid.c b/io_uring/waitid.c
index f25110fb1b12..53532ae6256c 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -250,7 +250,7 @@ int io_waitid_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
return -EINVAL;
iwa = io_uring_alloc_async_data(NULL, req);
- if (!unlikely(iwa))
+ if (unlikely(!iwa))
return -ENOMEM;
iwa->req = req;