Subject: Re: [PATCH] net: core: use __counted_by for trailing VLA of struct sock_reuseport

From: Jakub Kicinski <[email-masked]>
Date: Tue, 30 Jul 2024 17:01:42 -0700

On Tue, 30 Jul 2024 19:04:49 +0300 Dmitry Antipov wrote:
> -	unsigned int size = sizeof(struct sock_reuseport) +
> -		      sizeof(struct sock *) * max_socks;
> -	struct sock_reuseport *reuse = kzalloc(size, GFP_ATOMIC);
> +	struct sock_reuseport *reuse =
> +		kzalloc(struct_size(reuse, socks, max_socks), GFP_ATOMIC);
>  

please move the function call out of the init. It doesn't fit on a
single line so what's the point..

> -	if (!reuse)
> +	if (unlikely(!reuse))

And why add the unlikely here? Seems unrelated..
-- 
pw-bot: cr