]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
tcp_yeah: check struct yeah size at compile time
authorEric Dumazet <edumazet@google.com>
Tue, 29 Jun 2021 13:52:13 +0000 (06:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jun 2021 18:54:36 +0000 (11:54 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_yeah.c

index 3bb448761ca38ab169ebac02c5f39020e7469ba9..07c4c93b9fdb65a513d99532ed7c066cec7d89f4 100644 (file)
@@ -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;
 }