io_uring: Fix uninitialized use of ret in io_eventfd_register()
PATCH 1/1 io_uring: Fix uninitialized use of ret in io_eventfd_register()
In some scenarios, ret is not assigned in the whole process, so it needs to be initialized at the beginning.
Clean up the following clang warning:
fs/io_uring.c:9373:13: note: initialize the variable 'ret' to silence this warning.
--- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
@@ -9370,7 +9370,7 @@ static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg, {struct io_ev_fd *ev_fd;__s32 __user *fds = arg; -int fd, ret; +int fd, ret =0 ; ev_fd =rcu_dereference_protected (ctx->io_ev_fd,lockdep_is_held (&ctx->uring_lock));
Signature · 1 line
2.20.1.7.g153144c
Quoted 11 lines · Jiapeng Chong
In some scenarios, ret is not assigned in the whole process, so it needs to be initialized at the beginning.
Clean up the following clang warning:
fs/io_uring.c:9373:13: note: initialize the variable 'ret' to silence this warning.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>---
This is already fixed in commit4c65723081332607ca331072b0f8a90189e2e447 ("io_uring: Fix use of uninitialized ret in io_eventfd_register()")
https://lore.kernel.org/all/[email protected]/T/
https://github.com/torvalds/linux/commit/4c65723081332607ca331072b0f8a90189e2e447.patch
Signature · 1 line
Ammar Faizi