Subject: Re: [PATCH net-next 1/6] tcp_metrics: panic when tcp_metrics can not be allocated

From: Sergei Shtylyov <[email-masked]>
Date: Mon, 09 Mar 2015 21:50:09 +0300

Hello.

On 3/9/2015 9:27 PM, Eric W. Biederman wrote:

> Panic so that in the unlikely event we have problems we will have a
> clear place to start debugging instead of a mysterious NULL pointer
> deference later on.

> Signed-off-by: "Eric W. Biederman" <[email-masked]>
> ---
>   net/ipv4/tcp_metrics.c | 1 +
>   1 file changed, 1 insertion(+)

> diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
> index e5f41bd5ec1b..fdf4bdda971f 100644
> --- a/net/ipv4/tcp_metrics.c
> +++ b/net/ipv4/tcp_metrics.c
> @@ -1186,5 +1186,6 @@ cleanup_subsys:
>   	unregister_pernet_subsys(&tcp_net_metrics_ops);
>
>   cleanup:
> +	panic("Could not allocate the tcp_metrics hash table\n");
>   	return;

    You can drop this *return* as well, it serves not purpose.

>   }

WBR, Sergei