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-Tag: v4.13.6~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c284a72869fe25a20c214d68c08f92b0f3e4e8ce;p=thirdparty%2Fkernel%2Fstable.git dm crypt: fix memory leak in crypt_ctr_cipher_old() commit bd86e32059526e2d0d13ca1e4447dfbbddb6e5cc upstream. Fix memory leak of cipher_api. Fixes: 33d2f09fcb35 (dm crypt: introduce new format of cipher with "capi:" prefix) Signed-off-by: Jeffy Chen Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index cefc27abaad8a..e3dd64a12f554 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2470,6 +2470,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: