mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
dd6eec242b
commit
b884f8b901
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue