diff options
author | Eric Biggers <ebiggers@google.com> | 2018-04-30 18:51:37 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-05-20 16:21:00 -0400 |
commit | 9919479b835cb1c92b75965f2e120395078a1c55 (patch) | |
tree | 9a53724f12e5f694b54b6e25e9fc97927a92dda7 /fs | |
parent | 54222025f2fe8055fa88c39b5d9f68cbd76b1be0 (diff) |
fscrypt: remove unnecessary NULL check when allocating skcipher
crypto_alloc_skcipher() returns an ERR_PTR() on failure, not NULL.
Remove the unnecessary check for NULL.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/crypto/keyinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 05f5ee1f0705..d09df8f751df 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c | |||
@@ -318,8 +318,8 @@ int fscrypt_get_encryption_info(struct inode *inode) | |||
318 | goto out; | 318 | goto out; |
319 | } | 319 | } |
320 | ctfm = crypto_alloc_skcipher(cipher_str, 0, 0); | 320 | ctfm = crypto_alloc_skcipher(cipher_str, 0, 0); |
321 | if (!ctfm || IS_ERR(ctfm)) { | 321 | if (IS_ERR(ctfm)) { |
322 | res = ctfm ? PTR_ERR(ctfm) : -ENOMEM; | 322 | res = PTR_ERR(ctfm); |
323 | pr_debug("%s: error %d (inode %lu) allocating crypto tfm\n", | 323 | pr_debug("%s: error %d (inode %lu) allocating crypto tfm\n", |
324 | __func__, res, inode->i_ino); | 324 | __func__, res, inode->i_ino); |
325 | goto out; | 325 | goto out; |