]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tcp_metrics: panic when tcp_metrics_init fails.
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 13 Mar 2015 05:04:51 +0000 (00:04 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Mar 2015 05:57:07 +0000 (01:57 -0400)
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>
net/ipv4/tcp_metrics.c

index e5f41bd5ec1bcfe88199ec077f1558917b1be61b..4206b14d956d941fe2417c5b72be213db5e1cf9b 100644 (file)
@@ -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");
 }