diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-08-15 14:20:12 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-08-24 21:38:54 +0800 |
commit | 8bc1bfa02e37d63632f0cb65543e3e71acdccafb (patch) | |
tree | efaa5211f638f230f411e8240881c6b0b184a2ed | |
parent | c32f08d024e275059474b3c11c1fc2bc7f2de990 (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>
-rwxr-xr-x | drivers/crypto/dwc-spacc/spacc_aead.c | 4 |
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); |