aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 06:50:13 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-10 06:50:13 -0400
commit996b1dbadcbcafb899f022303e01d46ab87920eb (patch)
tree563e72e594a784903b96de59281df52af5ad2cfb
parent24e8b7e48471514c9311c733b3f399bd20d014fe (diff)
[SCTP]: Use snmp_mib_{init,free}().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/protocol.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 067c8a1658d6..b34437fdea26 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -972,24 +972,14 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family)
972 return 1; 972 return 1;
973} 973}
974 974
975static int __init init_sctp_mibs(void) 975static inline int init_sctp_mibs(void)
976{ 976{
977 sctp_statistics[0] = alloc_percpu(struct sctp_mib); 977 return snmp_mib_init((void**)sctp_statistics, sizeof(struct sctp_mib));
978 if (!sctp_statistics[0])
979 return -ENOMEM;
980 sctp_statistics[1] = alloc_percpu(struct sctp_mib);
981 if (!sctp_statistics[1]) {
982 free_percpu(sctp_statistics[0]);
983 return -ENOMEM;
984 }
985 return 0;
986
987} 978}
988 979
989static void cleanup_sctp_mibs(void) 980static inline void cleanup_sctp_mibs(void)
990{ 981{
991 free_percpu(sctp_statistics[0]); 982 snmp_mib_free((void**)sctp_statistics);
992 free_percpu(sctp_statistics[1]);
993} 983}
994 984
995static void sctp_v4_pf_init(void) 985static void sctp_v4_pf_init(void)