Re: [PATCH net-next v3 03/15] quic: provide common utilities and data structures

Simon Horman <[email protected]> Tue, 23 Sep 2025 10:06:41 +0100
Newsgroups dev.linux.lists.quic,dev.linux.lists.kernel-tls-handshake,org.kernel.vger.linux-cifs,org.kernel.vger.netdev
Message-ID <[email protected]>
On Thu, Sep 18, 2025 at 06:34:52PM -0400, Xin Long wrote:

> index f79f43f0c17f..b54532916aa2 100644
> --- a/net/quic/protocol.c
> +++ b/net/quic/protocol.c
> @@ -336,6 +336,9 @@ static __init int quic_init(void)
>  	if (err)
>  		goto err_percpu_counter;
>  
> +	if (quic_hash_tables_init())

Hi Xin,

If we reach here then the function will return err, which is 0.
So it seems that err should be set to a negative error value instead.
Perhaps the return value of quic_hash_tables_init.

Flagged by Smatch.


> +		goto err_hash;
> +
>  	err = register_pernet_subsys(&quic_net_ops);
>  	if (err)
>  		goto err_def_ops;
> @@ -353,6 +356,8 @@ static __init int quic_init(void)
>  err_protosw:
>  	unregister_pernet_subsys(&quic_net_ops);
>  err_def_ops:
> +	quic_hash_tables_destroy();
> +err_hash:
>  	percpu_counter_destroy(&quic_sockets_allocated);
>  err_percpu_counter:
>  	return err;

...