Skip to content

Commit 3f61b05

Browse files
zhengbin13herbertx
authored andcommitted
crypto: inside-secure - Use PTR_ERR_OR_ZERO() to simplify code
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>
1 parent e42617b commit 3f61b05

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎drivers/crypto/inside-secure/safexcel_cipher.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,10 +2532,7 @@ static int safexcel_aead_gcm_cra_init(struct crypto_tfm *tfm)
25322532
ctx->mode = CONTEXT_CONTROL_CRYPTO_MODE_XCM; /* override default */
25332533

25342534
ctx->hkaes = crypto_alloc_cipher("aes", 0, 0);
2535-
if (IS_ERR(ctx->hkaes))
2536-
return PTR_ERR(ctx->hkaes);
2537-
2538-
return 0;
2535+
return PTR_ERR_OR_ZERO(ctx->hkaes);
25392536
}
25402537

25412538
static void safexcel_aead_gcm_cra_exit(struct crypto_tfm *tfm)

0 commit comments

Comments
 (0)