diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2015-03-13 01:04:51 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-03-13 01:57:07 -0400 |
| commit | 6493517eaea9b052e081e557f7c8bb06cc6b1852 (patch) | |
| tree | a546f8deb8557ff14314a7e5f3edabeb03c299ab | |
| parent | 719a11cdbf57b7bdd6c87ded00fd7cb36a76a6a3 (diff) | |
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>
| -rw-r--r-- | net/ipv4/tcp_metrics.c | 12 |
1 files changed, 3 insertions, 9 deletions
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) | |||
| 1175 | 1175 | ||
| 1176 | ret = register_pernet_subsys(&tcp_net_metrics_ops); | 1176 | ret = register_pernet_subsys(&tcp_net_metrics_ops); |
| 1177 | if (ret < 0) | 1177 | if (ret < 0) |
| 1178 | goto cleanup; | 1178 | panic("Could not allocate the tcp_metrics hash table\n"); |
| 1179 | |||
| 1179 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, | 1180 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, |
| 1180 | tcp_metrics_nl_ops); | 1181 | tcp_metrics_nl_ops); |
| 1181 | if (ret < 0) | 1182 | if (ret < 0) |
| 1182 | goto cleanup_subsys; | 1183 | panic("Could not register tcp_metrics generic netlink\n"); |
| 1183 | return; | ||
| 1184 | |||
| 1185 | cleanup_subsys: | ||
| 1186 | unregister_pernet_subsys(&tcp_net_metrics_ops); | ||
| 1187 | |||
| 1188 | cleanup: | ||
| 1189 | return; | ||
| 1190 | } | 1184 | } |
