diff options
| author | Eric Biggers <ebiggers@google.com> | 2018-04-30 15:51:37 -0700 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-06-28 12:18:52 -0700 |
| commit | f68d3b84aef18bb91329907995d2c7e083ae8c75 (patch) | |
| tree | cc6d1fa2f3f61e5482bc3b5800fc0a33ec163734 | |
| parent | fb10231825e94a1eea7d5e0b9d23824b6add6113 (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>
| -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 7c00331da5df..7750179bba4b 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -317,8 +317,8 @@ int fscrypt_get_encryption_info(struct inode *inode) goto out; } ctfm = crypto_alloc_skcipher(cipher_str, 0, 0); - if (!ctfm || IS_ERR(ctfm)) { - res = ctfm ? PTR_ERR(ctfm) : -ENOMEM; + if (IS_ERR(ctfm)) { + res = PTR_ERR(ctfm); pr_debug("%s: error %d (inode %lu) allocating crypto tfm\n", __func__, res, inode->i_ino); goto out; |
