tcp_metrics: panic when tcp_metrics_init fails.
There is not a practical way to cleanup during boot so just panic if there is a problem initializing tcp_metrics. That will at least give us a clear place to start debugging if something does go wrong. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
719a11cdbf
commit
6493517eae
1 changed files with 3 additions and 9 deletions
|
@ -1175,16 +1175,10 @@ void __init tcp_metrics_init(void)
|
||||||
|
|
||||||
ret = register_pernet_subsys(&tcp_net_metrics_ops);
|
ret = register_pernet_subsys(&tcp_net_metrics_ops);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto cleanup;
|
panic("Could not allocate the tcp_metrics hash table\n");
|
||||||
|
|
||||||
ret = genl_register_family_with_ops(&tcp_metrics_nl_family,
|
ret = genl_register_family_with_ops(&tcp_metrics_nl_family,
|
||||||
tcp_metrics_nl_ops);
|
tcp_metrics_nl_ops);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto cleanup_subsys;
|
panic("Could not register tcp_metrics generic netlink\n");
|
||||||
return;
|
|
||||||
|
|
||||||
cleanup_subsys:
|
|
||||||
unregister_pernet_subsys(&tcp_net_metrics_ops);
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue