diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/proto.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index e3f5d37b84be..d534cdf9603b 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -1010,33 +1010,14 @@ void dccp_shutdown(struct sock *sk, int how) | |||
1010 | 1010 | ||
1011 | EXPORT_SYMBOL_GPL(dccp_shutdown); | 1011 | EXPORT_SYMBOL_GPL(dccp_shutdown); |
1012 | 1012 | ||
1013 | static int __init dccp_mib_init(void) | 1013 | static inline int dccp_mib_init(void) |
1014 | { | 1014 | { |
1015 | int rc = -ENOMEM; | 1015 | return snmp_mib_init((void**)dccp_statistics, sizeof(struct dccp_mib)); |
1016 | |||
1017 | dccp_statistics[0] = alloc_percpu(struct dccp_mib); | ||
1018 | if (dccp_statistics[0] == NULL) | ||
1019 | goto out; | ||
1020 | |||
1021 | dccp_statistics[1] = alloc_percpu(struct dccp_mib); | ||
1022 | if (dccp_statistics[1] == NULL) | ||
1023 | goto out_free_one; | ||
1024 | |||
1025 | rc = 0; | ||
1026 | out: | ||
1027 | return rc; | ||
1028 | out_free_one: | ||
1029 | free_percpu(dccp_statistics[0]); | ||
1030 | dccp_statistics[0] = NULL; | ||
1031 | goto out; | ||
1032 | |||
1033 | } | 1016 | } |
1034 | 1017 | ||
1035 | static void dccp_mib_exit(void) | 1018 | static inline void dccp_mib_exit(void) |
1036 | { | 1019 | { |
1037 | free_percpu(dccp_statistics[0]); | 1020 | snmp_mib_free((void**)dccp_statistics); |
1038 | free_percpu(dccp_statistics[1]); | ||
1039 | dccp_statistics[0] = dccp_statistics[1] = NULL; | ||
1040 | } | 1021 | } |
1041 | 1022 | ||
1042 | static int thash_entries; | 1023 | static int thash_entries; |