Commit 24e8b7e4 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

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

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 387a5487
...@@ -1010,33 +1010,14 @@ void dccp_shutdown(struct sock *sk, int how) ...@@ -1010,33 +1010,14 @@ void dccp_shutdown(struct sock *sk, int how)
EXPORT_SYMBOL_GPL(dccp_shutdown); EXPORT_SYMBOL_GPL(dccp_shutdown);
static int __init dccp_mib_init(void) static inline int dccp_mib_init(void)
{ {
int rc = -ENOMEM; return snmp_mib_init((void**)dccp_statistics, sizeof(struct dccp_mib));
dccp_statistics[0] = alloc_percpu(struct dccp_mib);
if (dccp_statistics[0] == NULL)
goto out;
dccp_statistics[1] = alloc_percpu(struct dccp_mib);
if (dccp_statistics[1] == NULL)
goto out_free_one;
rc = 0;
out:
return rc;
out_free_one:
free_percpu(dccp_statistics[0]);
dccp_statistics[0] = NULL;
goto out;
} }
static void dccp_mib_exit(void) static inline void dccp_mib_exit(void)
{ {
free_percpu(dccp_statistics[0]); snmp_mib_free((void**)dccp_statistics);
free_percpu(dccp_statistics[1]);
dccp_statistics[0] = dccp_statistics[1] = NULL;
} }
static int thash_entries; static int thash_entries;
......
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