Commit b884f8b9 authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by Herbert Xu

crypto: lrw - fix memleak

LRW module leaks child cipher memory when init_tfm() fails because of child
block size not being 16.
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dd6eec24
...@@ -220,6 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm) ...@@ -220,6 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm)
if (crypto_cipher_blocksize(cipher) != 16) { if (crypto_cipher_blocksize(cipher) != 16) {
*flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
crypto_free_cipher(cipher);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment