X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=crypto%2Fhmac.c;h=8b2a212eb0ad412e1d8a34d178c53d6eefb71342;hb=ae8766042beee814c9e16e9ae1e84cd6eaa7ffaa;hp=f03cb32147cc25194adf3f5ad53dcdbbfaa8a39d;hpb=01047631df813f6247185547c3778c80af088a20;p=tomoyo%2Ftomoyo-test1.git diff --git a/crypto/hmac.c b/crypto/hmac.c index f03cb32147cc..8b2a212eb0ad 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -152,8 +152,10 @@ static int hmac_init_tfm(struct crypto_tfm *tfm) parent->descsize = sizeof(struct shash_desc) + crypto_shash_descsize(hash); - if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) + if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) { + crypto_free_shash(hash); return -EINVAL; + } ctx->hash = hash; return 0;