summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorAlok Tiwari <alok.a.tiwari@oracle.com>2025-10-18 12:32:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 14:10:28 +0100
commit0dc956645e869dde49a0d03ee74000fc069f96a1 (patch)
tree38b80ec708b04524a286c6e6211b27a77a6f66cd /io_uring
parent9736fab64459051fbd95e5d1f7dbb74ec1c88a30 (diff)
downloadlinux-0dc956645e869dde49a0d03ee74000fc069f96a1.tar.gz
linux-0dc956645e869dde49a0d03ee74000fc069f96a1.tar.bz2
linux-0dc956645e869dde49a0d03ee74000fc069f96a1.zip
io_uring: fix incorrect unlikely() usage in io_waitid_prep()
[ Upstream commit 4ec703ec0c384a2199808c4eb2e9037236285a8d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-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 3101ad8ec0cf..c8ca00e681f7 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -252,7 +252,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;