]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/protocol.c
spi: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / net / sctp / protocol.c
index a8ca743241ee19379c54f3d96635e2133e4d0183..b78e3be6901398f7a62b76a291fb8954341aacc0 100644 (file)
@@ -102,6 +102,8 @@ struct sock *sctp_get_ctl_sock(void)
 /* 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) {
                struct proc_dir_entry *ent;
@@ -110,7 +112,7 @@ static __init int sctp_proc_init(void)
                        ent->owner = THIS_MODULE;
                        proc_net_sctp = ent;
                } else
-                       goto out_nomem;
+                       goto out_free_percpu;
        }
 
        if (sctp_snmp_proc_init())
@@ -135,11 +137,14 @@ out_snmp_proc_init:
                proc_net_sctp = NULL;
                remove_proc_entry("sctp", init_net.proc_net);
        }
-out_nomem:
-       return -ENOMEM;
+out_free_percpu:
+       percpu_counter_destroy(&sctp_sockets_allocated);
 #else
        return 0;
 #endif /* CONFIG_PROC_FS */
+
+out_nomem:
+       return -ENOMEM;
 }
 
 /* Clean up the proc fs entry for the SCTP protocol.