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>
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);