aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/proto.c27
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
1011EXPORT_SYMBOL_GPL(dccp_shutdown); 1011EXPORT_SYMBOL_GPL(dccp_shutdown);
1012 1012
1013static int __init dccp_mib_init(void) 1013static 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;
1026out:
1027 return rc;
1028out_free_one:
1029 free_percpu(dccp_statistics[0]);
1030 dccp_statistics[0] = NULL;
1031 goto out;
1032
1033} 1016}
1034 1017
1035static void dccp_mib_exit(void) 1018static 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
1042static int thash_entries; 1023static int thash_entries;