From: Jussi Kivilinna Date: Tue, 18 Oct 2011 10:32:14 +0000 (+0300) Subject: crypto: lrw - fix memleak X-Git-Tag: upstream/snapshot3+hdmi~8058^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b884f8b901b968b90d8d1b82d388583fa1b2605d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Herbert Xu --- diff --git a/crypto/lrw.c b/crypto/lrw.c index 358f80b..fca3246 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -220,6 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm) if (crypto_cipher_blocksize(cipher) != 16) { *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; + crypto_free_cipher(cipher); return -EINVAL; }