Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327414
b: refs/heads/master
c: 632c928
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Aug 15, 2012
1 parent 613ce1b commit 91d47d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ce955035081112cf1590c961da8d94324142b5e
refs/heads/master: 632c928a6a77fe96cda34a9978e1f6019ffc38f4
13 changes: 7 additions & 6 deletions trunk/net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ int sysctl_sctp_wmem[3];
/* Set up the proc fs entry for the SCTP protocol. */
static __init int sctp_proc_init(void)
{
if (percpu_counter_init(&sctp_sockets_allocated, 0))
goto out_nomem;
#ifdef CONFIG_PROC_FS
if (!proc_net_sctp) {
proc_net_sctp = proc_mkdir("sctp", init_net.proc_net);
Expand Down Expand Up @@ -125,12 +123,9 @@ static __init int sctp_proc_init(void)
remove_proc_entry("sctp", init_net.proc_net);
}
out_free_percpu:
percpu_counter_destroy(&sctp_sockets_allocated);
#else
return 0;
#endif /* CONFIG_PROC_FS */

out_nomem:
return -ENOMEM;
}

Expand All @@ -151,7 +146,6 @@ static void sctp_proc_exit(void)
remove_proc_entry("sctp", init_net.proc_net);
}
#endif
percpu_counter_destroy(&sctp_sockets_allocated);
}

/* Private helper to extract ipv4 address and stash them in
Expand Down Expand Up @@ -1261,6 +1255,10 @@ SCTP_STATIC __init int sctp_init(void)
if (status)
goto err_init_mibs;

status = percpu_counter_init(&sctp_sockets_allocated, 0);
if (status)
goto err_percpu_counter_init;

/* Initialize proc fs directory. */
status = sctp_proc_init();
if (status)
Expand Down Expand Up @@ -1481,6 +1479,8 @@ SCTP_STATIC __init int sctp_init(void)
sctp_dbg_objcnt_exit();
sctp_proc_exit();
err_init_proc:
percpu_counter_destroy(&sctp_sockets_allocated);
err_percpu_counter_init:
cleanup_sctp_mibs();
err_init_mibs:
kmem_cache_destroy(sctp_chunk_cachep);
Expand Down Expand Up @@ -1521,6 +1521,7 @@ SCTP_STATIC __exit void sctp_exit(void)
sizeof(struct sctp_bind_hashbucket)));

sctp_dbg_objcnt_exit();
percpu_counter_destroy(&sctp_sockets_allocated);
sctp_proc_exit();
cleanup_sctp_mibs();

Expand Down

0 comments on commit 91d47d0

Please sign in to comment.