lkml.org 
[lkml]   [2023]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] io_uring: initialize count variable to 0
Date
The clang build fails with
io_uring/io_uring.c:1240:3: error: variable 'count' is uninitialized
when used here [-Werror,-Wuninitialized]
count += handle_tw_list(node, &ctx, &uring_locked, &fake);
^~~~~

The commit listed in the fixes: removed the initialization of count.

Fixes: b5b57128d0cd ("io_uring: refactor tctx_task_work")
Signed-off-by: Tom Rix <trix@redhat.com>
---
io_uring/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 734d074cdd94..4cb409ae9840 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1227,7 +1227,7 @@ void tctx_task_work(struct callback_head *cb)
struct llist_node fake = {};
struct llist_node *node;
unsigned int loops = 0;
- unsigned int count;
+ unsigned int count = 0;

if (unlikely(current->flags & PF_EXITING)) {
io_fallback_tw(tctx);
--
2.26.3
\
 
 \ /
  Last update: 2023-03-26 23:54    [W:0.038 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site