From b7d7c1b5c40572cdaab0b5b7684da03e2f2a5e58 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Thu, 10 Apr 2008 03:50:13 -0700 Subject: [PATCH] --- yaml --- r: 90618 b: refs/heads/master c: 996b1dbadcbcafb899f022303e01d46ab87920eb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/sctp/protocol.c | 18 ++++-------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index bf1c9de68ce8..24ab8866edf5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 24e8b7e48471514c9311c733b3f399bd20d014fe +refs/heads/master: 996b1dbadcbcafb899f022303e01d46ab87920eb diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index 067c8a1658d6..b34437fdea26 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -972,24 +972,14 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family) return 1; } -static int __init init_sctp_mibs(void) +static inline int init_sctp_mibs(void) { - sctp_statistics[0] = alloc_percpu(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; - + return snmp_mib_init((void**)sctp_statistics, sizeof(struct sctp_mib)); } -static void cleanup_sctp_mibs(void) +static inline void cleanup_sctp_mibs(void) { - free_percpu(sctp_statistics[0]); - free_percpu(sctp_statistics[1]); + snmp_mib_free((void**)sctp_statistics); } static void sctp_v4_pf_init(void)