UPSTREAM: crypto: api - Fix boot-up crash when crypto manager is disabled

When the crypto manager is disabled, we need to explicitly set
the crypto algorithms' tested status so that they can be used.

Fixes: cad439fc040e ("crypto: api - Do not create test larvals if...")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: Ido Schimmel <idosch@idosch.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Bug: 256875295
(cherry picked from commit beaaaa37c664e9afdf2913aee19185d8e3793b50)
Change-Id: I6cb42580e4774fbfd075497468b488be3447b7a9
Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
Herbert Xu
2021-11-05 15:26:08 +08:00
committed by Eric Biggers
parent 3f5a00a5ef
commit 9662706fb0

View File

@@ -284,6 +284,8 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
if (larval)
list_add(&larval->alg.cra_list, &crypto_alg_list);
else
alg->cra_flags |= CRYPTO_ALG_TESTED;
crypto_stats_init(alg);