Commit 8bc1bfa0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu

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: 06af76b4 ("crypto: spacc - Add SPAcc aead support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c32f08d0
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment