diff options
Diffstat (limited to 'fs/ext4/crypto_fname.c')
-rw-r--r-- | fs/ext4/crypto_fname.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/crypto_fname.c b/fs/ext4/crypto_fname.c index fded02f72299..b7a39a185d01 100644 --- a/fs/ext4/crypto_fname.c +++ b/fs/ext4/crypto_fname.c @@ -346,8 +346,9 @@ struct ext4_fname_crypto_ctx *ext4_get_fname_crypto_ctx( if (res == 0) return NULL; - if (!ext4_has_encryption_key(inode)) - ext4_generate_encryption_key(inode); + res = ext4_generate_encryption_key(inode); + if (res) + return ERR_PTR(res); /* Get a crypto context based on the key. * A new context is allocated if no context matches the requested key. |