Skip to contentSkip to conversation

selftests: tls: fix warning of uninitialized variable

PATCH Applied Ankit Khushwaha 4 participants 5 messages Dec 5, 2025 – Dec 10, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests: tls: fix warning of uninitialized variable

In 'poll_partial_rec_async' a uninitialized char variable 'token' with is used for write/read instruction to synchronize between threads via a pipe.

tls.c:2833:26: warning: variable 'token' is uninitialized
when passed as a const pointer argument

Initialize 'token' to '\0' to silence compiler warning.

---
compiler used: clang version 21.1.5 (Fedora 21.1.5-1.fc43).

changelog:
v2:
- update patch name and msg

v1: https://lore.kernel.org/all/[email protected]/

---
 tools/testing/selftests/net/tls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/tls.c +1 -1
index a3ef4b57eb5f..a4d16a460fbe 100644
@@ -2786,10 +2786,10 @@ TEST_F(tls_err, epoll_partial_rec)
 TEST_F(tls_err, poll_partial_rec_async)
 {
 	struct pollfd pfd = { };
+	char token = '\0';
 	ssize_t rec_len;
 	char rec[256];
 	char buf[128];
-	char token;
 	int p[2];
 	int ret;
 

--
2.52.0

reviewer
#1 lore raw
Quoted 10 lines · Ankit Khushwaha

In 'poll_partial_rec_async' a uninitialized char variable 'token' with is used for write/read instruction to synchronize between threads via a pipe.

tls.c:2833:26: warning: variable 'token' is uninitialized
when passed as a const pointer argument

Initialize 'token' to '\0' to silence compiler warning.

Quoted 8 lines

---
compiler used: clang version 21.1.5 (Fedora 21.1.5-1.fc43).

changelog:
v2:
- update patch name and msg

v1: https://lore.kernel.org/all/[email protected]/

Hi Ankit,

Thanks for the update. Overall this seems good to me, however, net-next is currently closed.

## Form letter - net-next-closed

The merge window for v6.19 has begun and therefore net-next has closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only.

Please repost when net-next reopens.

Due to a combination of the merge-window, travel commitments of the maintainers, and the holiday season, net-next will re-open after 2nd January.

RFC patches sent for review only are welcome at any time.

See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle

Signature · 1 line
pw-bot: defer
maintainer
#2 lore raw
Quoted 2 lines · On Sat, 6 Dec 2025 10:27:01 +0000 Simon Horman wrote:

Thanks for the update. Overall this seems good to me, however, net-next is currently closed.

FWIW after Simon made this comment more fixes for various ksft warnings got posted, I think we should apply them now and to be consistent I'll also take this one.

reviewer Reviewed-by
#3 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Sat, 6 Dec 2025 10:27:01 +0000 Simon Horman wrote:

Thanks for the update. Overall this seems good to me, however, net-next is currently closed.

FWIW after Simon made this comment more fixes for various ksft warnings got posted, I think we should apply them now and to be consistent I'll also take this one.

Understood. I'm always a little unsure where selftest changes should best land.

In any case, feel free to add my tag as this does look good to me.

#4 lore raw
In reply to Ankit Khushwaha
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 5 Dec 2025 22:02:42 +0530 you wrote:

In 'poll_partial_rec_async' a uninitialized char variable 'token' with is used for write/read instruction to synchronize between threads via a pipe.

tls.c:2833:26: warning: variable 'token' is uninitialized
when passed as a const pointer argument

[...]

Here is the summary with links:
- [net-next,v2] selftests: tls: fix warning of uninitialized variable

    https://git.kernel.org/netdev/net/c/9580f6d47dd6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html