From: Eric W. Biederman Date: Fri, 13 Mar 2015 05:04:51 +0000 (-0500) Subject: tcp_metrics: panic when tcp_metrics_init fails. X-Git-Tag: v4.1-rc1~128^2~247^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6493517eaea9b052e081e557f7c8bb06cc6b1852;p=karo-tx-linux.git 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" Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index e5f41bd5ec1b..4206b14d956d 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c @@ -1175,16 +1175,10 @@ void __init tcp_metrics_init(void) ret = register_pernet_subsys(&tcp_net_metrics_ops); 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, tcp_metrics_nl_ops); if (ret < 0) - goto cleanup_subsys; - return; - -cleanup_subsys: - unregister_pernet_subsys(&tcp_net_metrics_ops); - -cleanup: - return; + panic("Could not register tcp_metrics generic netlink\n"); }