summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-08-15 14:20:12 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2024-08-24 21:38:54 +0800
commit8bc1bfa02e37d63632f0cb65543e3e71acdccafb (patch)
treeefaa5211f638f230f411e8240881c6b0b184a2ed /drivers/crypto
parentc32f08d024e275059474b3c11c1fc2bc7f2de990 (diff)
crypto: spacc - Fix NULL vs IS_ERR() check in spacc_aead_fallback()
The crypto_alloc_aead() function doesn't return NULL pointers, it returns error pointers. Fix the error checking. Fixes: 06af76b46c78 ("crypto: spacc - Add SPAcc aead support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rwxr-xr-xdrivers/crypto/dwc-spacc/spacc_aead.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/dwc-spacc/spacc_aead.c b/drivers/crypto/dwc-spacc/spacc_aead.c
index abf5971e919d..7f6c48881eab 100755
--- a/drivers/crypto/dwc-spacc/spacc_aead.c
+++ b/drivers/crypto/dwc-spacc/spacc_aead.c
@@ -769,9 +769,9 @@ static int spacc_aead_fallback(struct aead_request *req,
ctx->fb.aead = crypto_alloc_aead(aead_name, 0,
CRYPTO_ALG_NEED_FALLBACK |
CRYPTO_ALG_ASYNC);
- if (!ctx->fb.aead) {
+ if (IS_ERR(ctx->fb.aead)) {
pr_err("Spacc aead fallback tfm is NULL!\n");
- return -EINVAL;
+ return PTR_ERR(ctx->fb.aead);
}
subreq = aead_request_alloc(ctx->fb.aead, GFP_KERNEL);