diff mbox series

[net-next] tcp_yeah: check struct yeah size at compile time

Message ID 20210629135213.1070529-1-eric.dumazet@gmail.com
State New
Headers show
Series [net-next] tcp_yeah: check struct yeah size at compile time | expand

Commit Message

Eric Dumazet June 29, 2021, 1:52 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

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

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_yeah.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index 3bb448761ca38ab169ebac02c5f39020e7469ba9..07c4c93b9fdb65a513d99532ed7c066cec7d89f4 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -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;
 }