Skip to content

Commit

Permalink
tcp_metrics: panic when tcp_metrics_init fails.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Mar 13, 2015
1 parent 719a11c commit 6493517
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions net/ipv4/tcp_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 6493517

Please sign in to comment.