author: Eric Biggers <ebiggers@google.com> 2019-10-24 14:54:36 -0700
committer: Eric Biggers <ebiggers@google.com> 2019-11-06 12:34:36 -0800
commit: b103fb7653fff09e7a6fb6ba9398a41584e7ae36
parent: ff73c2c016f8569b728eb1e9ebfab383545e4d65
Commit Summary:
Diffstat:
1 file changed, 4 insertions, 2 deletions
diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c
index c34fa7c61b43..040df1f5e1c8 100644
--- a/fs/crypto/keyring.c
+++ b/fs/crypto/keyring.c
@@ -43,8 +43,10 @@ static void free_master_key(struct fscrypt_master_key *mk)
wipe_master_key_secret(&mk->mk_secret);
- for (i = 0; i < ARRAY_SIZE(mk->mk_mode_keys); i++)
- crypto_free_skcipher(mk->mk_mode_keys[i]);
+ for (i = 0; i <= __FSCRYPT_MODE_MAX; i++) {
+ crypto_free_skcipher(mk->mk_direct_tfms[i]);
+ crypto_free_skcipher(mk->mk_iv_ino_lblk_64_tfms[i]);
+ }
key_put(mk->mk_users);
kzfree(mk);