diff options
-rw-r--r-- | net/dccp/proto.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 3ba1ff435798..abab6c10af96 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -933,7 +933,7 @@ void dccp_ctl_sock_exit(void) | |||
933 | EXPORT_SYMBOL_GPL(dccp_ctl_sock_exit); | 933 | EXPORT_SYMBOL_GPL(dccp_ctl_sock_exit); |
934 | #endif | 934 | #endif |
935 | 935 | ||
936 | static int __init init_dccp_v4_mibs(void) | 936 | static int __init dccp_mib_init(void) |
937 | { | 937 | { |
938 | int rc = -ENOMEM; | 938 | int rc = -ENOMEM; |
939 | 939 | ||
@@ -955,6 +955,13 @@ out_free_one: | |||
955 | 955 | ||
956 | } | 956 | } |
957 | 957 | ||
958 | static int dccp_mib_exit(void) | ||
959 | { | ||
960 | free_percpu(dccp_statistics[0]); | ||
961 | free_percpu(dccp_statistics[1]); | ||
962 | dccp_statistics[0] = dccp_statistics[1] = NULL; | ||
963 | } | ||
964 | |||
958 | static int thash_entries; | 965 | static int thash_entries; |
959 | module_param(thash_entries, int, 0444); | 966 | module_param(thash_entries, int, 0444); |
960 | MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); | 967 | MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); |
@@ -1044,7 +1051,7 @@ static int __init dccp_init(void) | |||
1044 | INIT_HLIST_HEAD(&dccp_hashinfo.bhash[i].chain); | 1051 | INIT_HLIST_HEAD(&dccp_hashinfo.bhash[i].chain); |
1045 | } | 1052 | } |
1046 | 1053 | ||
1047 | rc = init_dccp_v4_mibs(); | 1054 | rc = dccp_mib_init(); |
1048 | if (rc) | 1055 | if (rc) |
1049 | goto out_free_dccp_bhash; | 1056 | goto out_free_dccp_bhash; |
1050 | 1057 | ||
@@ -1075,9 +1082,7 @@ out_unregister_protosw: | |||
1075 | inet_unregister_protosw(&dccp_v4_protosw); | 1082 | inet_unregister_protosw(&dccp_v4_protosw); |
1076 | inet_del_protocol(&dccp_protocol, IPPROTO_DCCP); | 1083 | inet_del_protocol(&dccp_protocol, IPPROTO_DCCP); |
1077 | out_free_dccp_v4_mibs: | 1084 | out_free_dccp_v4_mibs: |
1078 | free_percpu(dccp_statistics[0]); | 1085 | dccp_mib_exit(); |
1079 | free_percpu(dccp_statistics[1]); | ||
1080 | dccp_statistics[0] = dccp_statistics[1] = NULL; | ||
1081 | out_free_dccp_bhash: | 1086 | out_free_dccp_bhash: |
1082 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); | 1087 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); |
1083 | dccp_hashinfo.bhash = NULL; | 1088 | dccp_hashinfo.bhash = NULL; |
@@ -1102,8 +1107,7 @@ static void __exit dccp_fini(void) | |||
1102 | if (inet_del_protocol(&dccp_protocol, IPPROTO_DCCP) < 0) | 1107 | if (inet_del_protocol(&dccp_protocol, IPPROTO_DCCP) < 0) |
1103 | printk(dccp_del_proto_err_msg); | 1108 | printk(dccp_del_proto_err_msg); |
1104 | 1109 | ||
1105 | free_percpu(dccp_statistics[0]); | 1110 | dccp_mib_exit(); |
1106 | free_percpu(dccp_statistics[1]); | ||
1107 | free_pages((unsigned long)dccp_hashinfo.bhash, | 1111 | free_pages((unsigned long)dccp_hashinfo.bhash, |
1108 | get_order(dccp_hashinfo.bhash_size * | 1112 | get_order(dccp_hashinfo.bhash_size * |
1109 | sizeof(struct inet_bind_hashbucket))); | 1113 | sizeof(struct inet_bind_hashbucket))); |