On Fri, Jan 16, 2009 at 03:10:20PM +0800, Huang Ying wrote:
>
> v5:
>
> - Move declaration to crypto/cryptd.h
>
> - Fix allocation error processing in cryptd_alloc_ablkcipher()
>
> Signed-off-by: Huang Ying <[email protected]>
OK we're nearly there :)
> +struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
> + u32 type, u32 mask)
> +{
> + char cryptd_alg_name[CRYPTO_MAX_ALG_NAME];
> + struct crypto_ablkcipher *tfm;
> +
> + if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
> + "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
> + return ERR_PTR(-EINVAL);
> + tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask);
> + if (IS_ERR(tfm))
> + return ERR_CAST(tfm);
> + if (crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module != THIS_MODULE)
> + return ERR_PTR(-EINVAL);
Need to free the tfm here or it'll be leaked.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html