Commit 996b1dba authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[SCTP]: Use snmp_mib_{init,free}().

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24e8b7e4
...@@ -972,24 +972,14 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family) ...@@ -972,24 +972,14 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family)
return 1; return 1;
} }
static int __init init_sctp_mibs(void) static inline int init_sctp_mibs(void)
{ {
sctp_statistics[0] = alloc_percpu(struct sctp_mib); return snmp_mib_init((void**)sctp_statistics, sizeof(struct sctp_mib));
if (!sctp_statistics[0])
return -ENOMEM;
sctp_statistics[1] = alloc_percpu(struct sctp_mib);
if (!sctp_statistics[1]) {
free_percpu(sctp_statistics[0]);
return -ENOMEM;
}
return 0;
} }
static void cleanup_sctp_mibs(void) static inline void cleanup_sctp_mibs(void)
{ {
free_percpu(sctp_statistics[0]); snmp_mib_free((void**)sctp_statistics);
free_percpu(sctp_statistics[1]);
} }
static void sctp_v4_pf_init(void) static void sctp_v4_pf_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment