dm crypt: fix memory leak in crypt_ctr_cipher_old()
authorJeffy Chen <[email protected]>
Wed, 27 Sep 2017 12:28:57 +0000 (20:28 +0800)
committerMike Snitzer <[email protected]>
Thu, 28 Sep 2017 16:19:02 +0000 (12:19 -0400)
Fix memory leak of cipher_api.

Fixes: 33d2f09fcb35 (dm crypt: introduce new format of cipher with "capi:" prefix)
Cc: [email protected] # 4.12+
Signed-off-by: Jeffy Chen <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
drivers/md/dm-crypt.c

index a55ffd4f5933fc1247b6729dcc0344964c9f01b8..75341fdca4b6bd059ac8591b59a5654d6bdf6737 100644 (file)
@@ -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: