* [PATCH] io_uring: Fix uninitialized use of ret in io_eventfd_register()
@ 2022-02-09 10:26 Jiapeng Chong
2022-02-09 11:06 ` Ammar Faizi
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-02-09 10:26 UTC (permalink / raw)
To: axboe; +Cc: asml.silence, io-uring, linux-kernel, Jiapeng Chong, Abaci Robot
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]>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5479f0607430..7f277890f1ec 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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));
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring: Fix uninitialized use of ret in io_eventfd_register()
2022-02-09 10:26 [PATCH] io_uring: Fix uninitialized use of ret in io_eventfd_register() Jiapeng Chong
@ 2022-02-09 11:06 ` Ammar Faizi
0 siblings, 0 replies; 2+ messages in thread
From: Ammar Faizi @ 2022-02-09 11:06 UTC (permalink / raw)
To: Jiapeng Chong, axboe; +Cc: asml.silence, io-uring, linux-kernel, Abaci Robot
On 2/9/22 5:26 PM, Jiapeng Chong wrote:
> 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 commit
4c65723081332607ca331072b0f8a90189e2e447 ("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
--
Ammar Faizi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-09 12:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-09 10:26 [PATCH] io_uring: Fix uninitialized use of ret in io_eventfd_register() Jiapeng Chong
2022-02-09 11:06 ` Ammar Faizi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox