* [PATCH] io_uring: initialize vairable "sqe" to silence build warning
@ 2025-10-22 15:07 Mallikarjun Thammanavar
2025-10-22 15:17 ` Greg KH
2025-10-22 15:26 ` Jens Axboe
0 siblings, 2 replies; 4+ messages in thread
From: Mallikarjun Thammanavar @ 2025-10-22 15:07 UTC (permalink / raw)
To: axboe
Cc: io-uring, linux-kernel, regressions, Mallikarjun Thammanavar,
kernelci . org bot
clang-17 compiler throws build error when [-Werror,-Wuninitialized] are enabled
error: variable 'sqe' is uninitialized when used here [-Werror,-Wuninitialized]
Initialize struct io_uring_sqe *sqe = NULL; to have clean build
Reported-by: kernelci.org bot <bot@kernelci.org>
Link: https://lore.kernel.org/regressions/176110914348.5309.724397608932251368@15dd6324cc71/
Signed-off-by: Mallikarjun Thammanavar <mallikarjunst09@gmail.com>
---
io_uring/fdinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index d5aa64203de5..e5792b794f8b 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -89,7 +89,7 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
seq_printf(m, "CachedCqTail:\t%u\n", data_race(ctx->cached_cq_tail));
seq_printf(m, "SQEs:\t%u\n", sq_tail - sq_head);
while (sq_head < sq_tail) {
- struct io_uring_sqe *sqe;
+ struct io_uring_sqe *sqe = NULL;
unsigned int sq_idx;
bool sqe128 = false;
u8 opcode;
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] io_uring: initialize vairable "sqe" to silence build warning
2025-10-22 15:07 [PATCH] io_uring: initialize vairable "sqe" to silence build warning Mallikarjun Thammanavar
@ 2025-10-22 15:17 ` Greg KH
2025-10-22 15:26 ` Jens Axboe
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2025-10-22 15:17 UTC (permalink / raw)
To: Mallikarjun Thammanavar
Cc: axboe, io-uring, linux-kernel, regressions, kernelci . org bot
On Wed, Oct 22, 2025 at 05:07:16PM +0200, Mallikarjun Thammanavar wrote:
> clang-17 compiler throws build error when [-Werror,-Wuninitialized] are enabled
> error: variable 'sqe' is uninitialized when used here [-Werror,-Wuninitialized]
>
> Initialize struct io_uring_sqe *sqe = NULL; to have clean build
> Reported-by: kernelci.org bot <bot@kernelci.org>
> Link: https://lore.kernel.org/regressions/176110914348.5309.724397608932251368@15dd6324cc71/
>
> Signed-off-by: Mallikarjun Thammanavar <mallikarjunst09@gmail.com>
> ---
> io_uring/fdinfo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
> index d5aa64203de5..e5792b794f8b 100644
> --- a/io_uring/fdinfo.c
> +++ b/io_uring/fdinfo.c
> @@ -89,7 +89,7 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
> seq_printf(m, "CachedCqTail:\t%u\n", data_race(ctx->cached_cq_tail));
> seq_printf(m, "SQEs:\t%u\n", sq_tail - sq_head);
> while (sq_head < sq_tail) {
> - struct io_uring_sqe *sqe;
> + struct io_uring_sqe *sqe = NULL;
If you do that, then other tools will report a NULL dereference, right?
Please fix the tools, don't paper over stuff like this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] io_uring: initialize vairable "sqe" to silence build warning
2025-10-22 15:07 [PATCH] io_uring: initialize vairable "sqe" to silence build warning Mallikarjun Thammanavar
2025-10-22 15:17 ` Greg KH
@ 2025-10-22 15:26 ` Jens Axboe
2025-10-22 15:59 ` Mallikarjun S T
1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2025-10-22 15:26 UTC (permalink / raw)
To: Mallikarjun Thammanavar
Cc: io-uring, linux-kernel, regressions, kernelci . org bot
On 10/22/25 9:07 AM, Mallikarjun Thammanavar wrote:
> clang-17 compiler throws build error when [-Werror,-Wuninitialized] are enabled
> error: variable 'sqe' is uninitialized when used here [-Werror,-Wuninitialized]
Already fixed, and as Greg mentioned, this may silence the warning but now it'll
cause a NULL pointer deref instead...
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] io_uring: initialize vairable "sqe" to silence build warning
2025-10-22 15:26 ` Jens Axboe
@ 2025-10-22 15:59 ` Mallikarjun S T
0 siblings, 0 replies; 4+ messages in thread
From: Mallikarjun S T @ 2025-10-22 15:59 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring, linux-kernel, regressions, kernelci . org bot
Thanks, Greg and Jens, for pointing this out.
I understand that this issue has already been fixed, and I’ll make
sure to pay closer attention in future submissions.
regards,
Mallikarjun
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-22 16:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 15:07 [PATCH] io_uring: initialize vairable "sqe" to silence build warning Mallikarjun Thammanavar
2025-10-22 15:17 ` Greg KH
2025-10-22 15:26 ` Jens Axboe
2025-10-22 15:59 ` Mallikarjun S T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox