]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
crypto: inside-secure - Use PTR_ERR_OR_ZERO() to simplify code
authorzhengbin <zhengbin13@huawei.com>
Mon, 18 Nov 2019 10:53:56 +0000 (18:53 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:34:44 +0000 (16:34 +0800)
Fixes coccicheck warning:

drivers/crypto/inside-secure/safexcel_cipher.c:2534:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_cipher.c

index c02995694b41a44bf55f6861cbfe28324908268b..08cb495256e3f9c6e993953ba1a0924bcb3ace80 100644 (file)
@@ -2532,10 +2532,7 @@ static int safexcel_aead_gcm_cra_init(struct crypto_tfm *tfm)
        ctx->mode = CONTEXT_CONTROL_CRYPTO_MODE_XCM; /* override default */
 
        ctx->hkaes = crypto_alloc_cipher("aes", 0, 0);
-       if (IS_ERR(ctx->hkaes))
-               return PTR_ERR(ctx->hkaes);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(ctx->hkaes);
 }
 
 static void safexcel_aead_gcm_cra_exit(struct crypto_tfm *tfm)