From: Eric Biggers Date: Mon, 30 Apr 2018 22:51:37 +0000 (-0700) Subject: fscrypt: remove unnecessary NULL check when allocating skcipher X-Git-Tag: v4.18-rc1~141^2~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9919479b835cb1c92b75965f2e120395078a1c55;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Theodore Ts'o --- diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 05f5ee1f07057..d09df8f751df0 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -318,8 +318,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;