From: Eric Dumazet Date: Tue, 29 Jun 2021 13:52:13 +0000 (-0700) Subject: tcp_yeah: check struct yeah size at compile time X-Git-Tag: v5.15~843^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6706721d82f86e9360c3ad5339fe3da5e0988a51;p=platform%2Fkernel%2Flinux-starfive.git tcp_yeah: check struct yeah size at compile time Compiler can perform the sanity check instead of waiting to load the module and crash the host. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c index 3bb4487..07c4c93 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; }