summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLaurent Navet <laurent.navet@gmail.com>2015-07-22 00:08:08 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-07-22 00:08:08 -0400
commitd76d99b219e1a233a720775c0451c310d34594e8 (patch)
tree379e71270b14e8475bbcc8c97c3de71420edaede /fs
parent5ba92bcf0dd63b35a85e90c3016989733b239bb5 (diff)
downloadlinux-d76d99b219e1a233a720775c0451c310d34594e8.tar.bz2
ext4 crypto: exit cleanly if ext4_derive_key_aes() fails
Return value of ext4_derive_key_aes() is stored but not used. Add test to exit cleanly if ext4_derive_key_aes() fail. Also fix coverity CID 1309760. Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/crypto_key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 442d24e8efc0..ce75bc8b9aef 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -220,6 +220,8 @@ retry:
BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
raw_key);
+ if (res)
+ goto out;
got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
if (!ctfm || IS_ERR(ctfm)) {