static int ah6_init_state(struct xfrm_state *x, void *args) 
static int ah6_init_state(struct xfrm_state *x) 
static int ah6_init_state(struct xfrm_state *x, void *args){	struct ah_data *ahp = NULL;	struct xfrm_algo_desc *aalg_desc;	if (!x->aalg)		goto error;	/* null auth can use a zero length key */	if (x->aalg->alg_key_len > 512)		goto error;	if (x->encap)		goto error;	ahp = kmalloc(sizeof(*ahp), GFP_KERNEL);	if (ahp == NULL)		return -ENOMEM;	memset(ahp, 0, sizeof(*ahp));	ahp->key = x->aalg->alg_key;	ahp->key_len = (x->aalg->alg_key_len+7)/8;	ahp->tfm = crypto_alloc_tfm(x->aalg->alg_name, 0);	if (!ahp->tfm)		goto error;	ahp->icv = ah_hmac_digest;		/*	 * Lookup the algorithm description maintained by xfrm_algo,	 * verify crypto transform properties, and store information	 * we need for AH processing.  This lookup cannot fail here	 * after a successful crypto_alloc_tfm().	 */	aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0);	BUG_ON(!aalg_desc);	if (aalg_desc->uinfo.auth.icv_fullbits/8 !=	    crypto_tfm_alg_digestsize(ahp->tfm)) {		printk(KERN_INFO "AH: %s digestsize %u != %hu\n",		       x->aalg->alg_name, crypto_tfm_alg_digestsize(ahp->tfm),		       aalg_desc->uinfo.auth.icv_fullbits/8);		goto error;	}		ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;	ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;		BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);		ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);	if (!ahp->work_icv)		goto error;		x->props.header_len = XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_trunc_len);	if (x->props.mode)		x->props.header_len += sizeof(struct ipv6hdr);	x->data = ahp;	return 0;error:	if (ahp) {		if (ahp->work_icv)			kfree(ahp->work_icv);		if (ahp->tfm)			crypto_free_tfm(ahp->tfm);		kfree(ahp);	}	return -EINVAL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/72cb6962a91f2af9eef69a06198e1949c10259ae/ah6.c/buggy/net/ipv6/ah6.c