]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/endpointola.c
Merge ../scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / net / sctp / endpointola.c
index 67bd53070ee0b31d0babb2221ccd57e03f81124b..9b6b394b66f649cf98f5f1e8189fa9131f2b956b 100644 (file)
@@ -144,6 +144,13 @@ void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
 {
        struct sock *sk = ep->base.sk;
 
+       /* If this is a temporary association, don't bother
+        * since we'll be removing it shortly and don't
+        * want anyone to find it anyway.
+        */
+       if (asoc->temp)
+               return;
+
        /* Now just add it to our list of asocs */
        list_add_tail(&asoc->asocs, &ep->asocs);
 
@@ -158,6 +165,12 @@ void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
 void sctp_endpoint_free(struct sctp_endpoint *ep)
 {
        ep->base.dead = 1;
+
+       ep->base.sk->sk_state = SCTP_SS_CLOSED;
+
+       /* Unlink this endpoint, so we can't find it again! */
+       sctp_unhash_endpoint(ep);
+
        sctp_endpoint_put(ep);
 }
 
@@ -166,13 +179,8 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
 {
        SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
 
-       ep->base.sk->sk_state = SCTP_SS_CLOSED;
-
-       /* Unlink this endpoint, so we can't find it again! */
-       sctp_unhash_endpoint(ep);
-
        /* Free up the HMAC transform. */
-       sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac);
+       crypto_free_hash(sctp_sk(ep->base.sk)->hmac);
 
        /* Cleanup. */
        sctp_inq_free(&ep->base.inqueue);