diff options
Diffstat (limited to 'net/sctp/associola.c')
| -rw-r--r-- | net/sctp/associola.c | 19 | 
1 files changed, 11 insertions, 8 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 2a6835b4562b..a9708da28eb5 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -71,9 +71,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a  {  	struct net *net = sock_net(sk);  	struct sctp_sock *sp; -	int i;  	sctp_paramhdr_t *p; -	int err; +	int i;  	/* Retrieve the SCTP per socket area.  */  	sp = sctp_sk((struct sock *)sk); @@ -247,6 +246,9 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a  	if (!sctp_ulpq_init(&asoc->ulpq, asoc))  		goto fail_init; +	if (sctp_stream_new(asoc, gfp)) +		goto fail_init; +  	/* Assume that peer would support both address types unless we are  	 * told otherwise.  	 */ @@ -264,9 +266,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a  	/* AUTH related initializations */  	INIT_LIST_HEAD(&asoc->endpoint_shared_keys); -	err = sctp_auth_asoc_copy_shkeys(ep, asoc, gfp); -	if (err) -		goto fail_init; +	if (sctp_auth_asoc_copy_shkeys(ep, asoc, gfp)) +		goto stream_free;  	asoc->active_key_id = ep->active_key_id;  	asoc->prsctp_enable = ep->prsctp_enable; @@ -289,6 +290,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a  	return asoc; +stream_free: +	sctp_stream_free(asoc->stream);  fail_init:  	sock_put(asoc->base.sk);  	sctp_endpoint_put(asoc->ep); @@ -1409,7 +1412,7 @@ sctp_assoc_choose_alter_transport(struct sctp_association *asoc,  /* Update the association's pmtu and frag_point by going through all the   * transports. This routine is called when a transport's PMTU has changed.   */ -void sctp_assoc_sync_pmtu(struct sock *sk, struct sctp_association *asoc) +void sctp_assoc_sync_pmtu(struct sctp_association *asoc)  {  	struct sctp_transport *t;  	__u32 pmtu = 0; @@ -1421,8 +1424,8 @@ void sctp_assoc_sync_pmtu(struct sock *sk, struct sctp_association *asoc)  	list_for_each_entry(t, &asoc->peer.transport_addr_list,  				transports) {  		if (t->pmtu_pending && t->dst) { -			sctp_transport_update_pmtu(sk, t, -						   SCTP_TRUNC4(dst_mtu(t->dst))); +			sctp_transport_update_pmtu( +					t, SCTP_TRUNC4(dst_mtu(t->dst)));  			t->pmtu_pending = 0;  		}  		if (!pmtu || (t->pathmtu < pmtu))  | 
