Skip to content

Commit

Permalink
crypto: inside-secure - Use PTR_ERR_OR_ZERO() to simplify code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhengbin authored and Herbert Xu committed Dec 11, 2019
1 parent e42617b commit 3f61b05
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/crypto/inside-secure/safexcel_cipher.c
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 3f61b05

Please sign in to comment.