if (addrs.v) kfree(addrs.v); 
kfree(addrs.v); 
struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,				 const struct sctp_chunk *chunk,				 gfp_t gfp, int unkparam_len){	sctp_inithdr_t initack;	struct sctp_chunk *retval;	union sctp_params addrs;	int addrs_len;	sctp_cookie_param_t *cookie;	int cookie_len;	size_t chunksize;	sctp_adaption_ind_param_t aiparam;	retval = NULL;	/* Note: there may be no addresses to embed. */	addrs = sctp_bind_addrs_to_raw(&asoc->base.bind_addr, &addrs_len, gfp);	initack.init_tag	        = htonl(asoc->c.my_vtag);	initack.a_rwnd			= htonl(asoc->rwnd);	initack.num_outbound_streams	= htons(asoc->c.sinit_num_ostreams);	initack.num_inbound_streams	= htons(asoc->c.sinit_max_instreams);	initack.initial_tsn		= htonl(asoc->c.initial_tsn);	/* FIXME:  We really ought to build the cookie right	 * into the packet instead of allocating more fresh memory.	 */	cookie = sctp_pack_cookie(asoc->ep, asoc, chunk, &cookie_len,				  addrs.v, addrs_len);	if (!cookie)		goto nomem_cookie;	/* Calculate the total size of allocation, include the reserved	 * space for reporting unknown parameters if it is specified.	 */	chunksize = sizeof(initack) + addrs_len + cookie_len + unkparam_len;        /* Tell peer that we'll do ECN only if peer advertised such cap.  */	if (asoc->peer.ecn_capable)		chunksize += sizeof(ecap_param);        /* Tell peer that we'll do PR-SCTP only if peer advertised.  */	if (asoc->peer.prsctp_capable)		chunksize += sizeof(prsctp_param);	chunksize += sizeof(aiparam);	/* Now allocate and fill out the chunk.  */	retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize);	if (!retval)		goto nomem_chunk;	/* Per the advice in RFC 2960 6.4, send this reply to	 * the source of the INIT packet.	 */	retval->transport = chunk->transport;	retval->subh.init_hdr =		sctp_addto_chunk(retval, sizeof(initack), &initack);	retval->param_hdr.v = sctp_addto_chunk(retval, addrs_len, addrs.v);	sctp_addto_chunk(retval, cookie_len, cookie);	if (asoc->peer.ecn_capable)		sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param);	if (asoc->peer.prsctp_capable)		sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);	aiparam.param_hdr.type = SCTP_PARAM_ADAPTION_LAYER_IND;	aiparam.param_hdr.length = htons(sizeof(aiparam));	aiparam.adaption_ind = htonl(sctp_sk(asoc->base.sk)->adaption_ind);	sctp_addto_chunk(retval, sizeof(aiparam), &aiparam);	/* We need to remove the const qualifier at this point.  */	retval->asoc = (struct sctp_association *) asoc;	/* RFC 2960 6.4 Multi-homed SCTP Endpoints	 *	 * An endpoint SHOULD transmit reply chunks (e.g., SACK,	 * HEARTBEAT ACK, * etc.) to the same destination transport	 * address from which it received the DATA or control chunk	 * to which it is replying.	 *	 * [INIT ACK back to where the INIT came from.]	 */	if (chunk)		retval->transport = chunk->transport;nomem_chunk:	kfree(cookie);nomem_cookie:	if (addrs.v)		kfree(addrs.v);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a51482bde22f99c63fbbb57d5d46cc666384e379/sm_make_chunk.c/buggy/net/sctp/sm_make_chunk.c