Skip to contentSkip to conversation

tcp_yeah: check struct yeah size at compile time

PATCH Applied Eric Dumazet 2 participants 2 messages Jun 29, 2021

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

PATCH 1/1 tcp_yeah: check struct yeah size at compile time

From: Eric Dumazet <[email protected]>

Compiler can perform the sanity check instead of waiting to load the module and crash the host.

---
 net/ipv4/tcp_yeah.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_yeah.c +1 -1
index 3bb448761ca38ab169ebac02c5f39020e7469ba9..07c4c93b9fdb65a513d99532ed7c066cec7d89f4 100644
@@ -221,7 +221,7 @@ static struct tcp_congestion_ops tcp_yeah __read_mostly = {
 
 static int __init tcp_yeah_register(void)
 {
-	BUG_ON(sizeof(struct yeah) > ICSK_CA_PRIV_SIZE);
+	BUILD_BUG_ON(sizeof(struct yeah) > ICSK_CA_PRIV_SIZE);
 	tcp_register_congestion_control(&tcp_yeah);
 	return 0;
 }
Signature · 1 line
2.32.0.93.g670b81a890-goog
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Tue, 29 Jun 2021 06:52:13 -0700 you wrote:

From: Eric Dumazet <[email protected]>

Compiler can perform the sanity check instead of waiting to load the module and crash the host.

[...]

Here is the summary with links:
- [net-next] tcp_yeah: check struct yeah size at compile time

    https://git.kernel.org/netdev/net-next/c/6706721d82f8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html