aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 06:48:43 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-10 06:48:43 -0400
commit24e8b7e48471514c9311c733b3f399bd20d014fe (patch)
tree6563b3ac632b01d71909313c6feb0ff704862d4f
parent387a5487f5a1f8bfc3b2c5818e50dfd19eeb4f3f (diff)
[DCCP]: Use snmp_mib_{init,free}().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-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;