diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index a8ca743241ee..d5ea232c9126 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -102,6 +102,8 @@ struct sock *sctp_get_ctl_sock(void) | |||
102 | /* Set up the proc fs entry for the SCTP protocol. */ | 102 | /* Set up the proc fs entry for the SCTP protocol. */ |
103 | static __init int sctp_proc_init(void) | 103 | static __init int sctp_proc_init(void) |
104 | { | 104 | { |
105 | if (percpu_counter_init(&sctp_sockets_allocated, 0)) | ||
106 | goto out_nomem; | ||
105 | #ifdef CONFIG_PROC_FS | 107 | #ifdef CONFIG_PROC_FS |
106 | if (!proc_net_sctp) { | 108 | if (!proc_net_sctp) { |
107 | struct proc_dir_entry *ent; | 109 | struct proc_dir_entry *ent; |
@@ -110,7 +112,7 @@ static __init int sctp_proc_init(void) | |||
110 | ent->owner = THIS_MODULE; | 112 | ent->owner = THIS_MODULE; |
111 | proc_net_sctp = ent; | 113 | proc_net_sctp = ent; |
112 | } else | 114 | } else |
113 | goto out_nomem; | 115 | goto out_free_percpu; |
114 | } | 116 | } |
115 | 117 | ||
116 | if (sctp_snmp_proc_init()) | 118 | if (sctp_snmp_proc_init()) |
@@ -135,6 +137,8 @@ out_snmp_proc_init: | |||
135 | proc_net_sctp = NULL; | 137 | proc_net_sctp = NULL; |
136 | remove_proc_entry("sctp", init_net.proc_net); | 138 | remove_proc_entry("sctp", init_net.proc_net); |
137 | } | 139 | } |
140 | out_free_percpu: | ||
141 | percpu_counter_destroy(&sctp_sockets_allocated); | ||
138 | out_nomem: | 142 | out_nomem: |
139 | return -ENOMEM; | 143 | return -ENOMEM; |
140 | #else | 144 | #else |