diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 18 |
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 | ||
975 | static int __init init_sctp_mibs(void) | 975 | static 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 | ||
989 | static void cleanup_sctp_mibs(void) | 980 | static 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 | ||
995 | static void sctp_v4_pf_init(void) | 985 | static void sctp_v4_pf_init(void) |