From: Jeffy Chen Date: Wed, 27 Sep 2017 12:28:57 +0000 (+0800) Subject: dm crypt: fix memory leak in crypt_ctr_cipher_old() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bd86e32059526e2d0d13ca1e4447dfbbddb6e5cc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dm crypt: fix memory leak in crypt_ctr_cipher_old() Fix memory leak of cipher_api. Fixes: 33d2f09fcb35 (dm crypt: introduce new format of cipher with "capi:" prefix) Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Jeffy Chen Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index a55ffd4f5933..75341fdca4b6 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2466,6 +2466,7 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key kfree(cipher_api); return ret; } + kfree(cipher_api); return 0; bad_mem: