[SCTP] Fix bug in sctp_init() error handling code.
authorNeil Horman <nhorman@redhat.com>
Thu, 28 Apr 2005 18:59:49 +0000 (11:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Apr 2005 18:59:49 +0000 (11:59 -0700)
Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/protocol.c

index b9813cf3d91c6ea8a99fa3e63f8f19636eae8e14..23c85a236c4197dce7c0681dea1849d8f10871b5 100644 (file)
@@ -1159,8 +1159,6 @@ SCTP_STATIC __init int sctp_init(void)
        status = 0;
 out:
        return status;
-err_add_protocol:
-       proto_unregister(&sctp_prot);
 err_ctl_sock_init:
        sctp_v6_exit();
 err_v6_init:
@@ -1188,6 +1186,8 @@ err_bucket_cachep:
        inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
        inet_unregister_protosw(&sctp_seqpacket_protosw);
        inet_unregister_protosw(&sctp_stream_protosw);
+err_add_protocol:
+       proto_unregister(&sctp_prot);
        goto out;
 }