From 6a997d5faa7b60da8785ec7498cd7bcf5f1611b9 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Thu, 9 Nov 2006 16:29:57 -0800 Subject: [PATCH] --- yaml --- r: 41609 b: refs/heads/master c: b68dbcab1dc70938fa5516d0ee82c0bf94e9a768 h: refs/heads/master i: 41607: eec403fa7ab2b00ecd89576286f1162a13b43892 v: v3 --- [refs] | 2 +- trunk/include/net/sctp/structs.h | 2 +- trunk/net/sctp/endpointola.c | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b656d2e99b08..14177f238371 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ec75fe85c58471db958386c1604e5006a2e2f69 +refs/heads/master: b68dbcab1dc70938fa5516d0ee82c0bf94e9a768 diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index c6d93bb0dcd2..5596f5d97ed2 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -1270,7 +1270,7 @@ struct sctp_endpoint { * this here so we pre-allocate this once and can re-use * on every receive. */ - __u8 digest[SCTP_SIGNATURE_SIZE]; + __u8 *digest; /* sendbuf acct. policy. */ __u32 sndbuf_policy; diff --git a/trunk/net/sctp/endpointola.c b/trunk/net/sctp/endpointola.c index 9b6b394b66f6..090f2b2a0cab 100644 --- a/trunk/net/sctp/endpointola.c +++ b/trunk/net/sctp/endpointola.c @@ -72,6 +72,10 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, { memset(ep, 0, sizeof(struct sctp_endpoint)); + ep->digest = kzalloc(SCTP_SIGNATURE_SIZE, gfp); + if (!ep->digest) + return NULL; + /* Initialize the base structure. */ /* What type of endpoint are we? */ ep->base.type = SCTP_EP_TYPE_SOCKET; @@ -182,6 +186,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) /* Free up the HMAC transform. */ crypto_free_hash(sctp_sk(ep->base.sk)->hmac); + /* Free the digest buffer */ + kfree(ep->digest); + /* Cleanup. */ sctp_inq_free(&ep->base.inqueue); sctp_bind_addr_free(&ep->base.bind_addr);