]> git.hungrycats.org Git - linux/commitdiff
dm crypt: fix memory leak in crypt_ctr_cipher_old()
authorJeffy Chen <jeffy.chen@rock-chips.com>
Wed, 27 Sep 2017 12:28:57 +0000 (20:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:18 +0000 (11:56 +0200)
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 <jeffy.chen@rock-chips.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-crypt.c

index cefc27abaad8a7caa9b063ac9263c4f79127e072..e3dd64a12f554863325ff277c555941e84c517b9 100644 (file)
@@ -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: