diff mbox series

[5.10,4/4] crypto: api - Fix boot-up crash when crypto manager is disabled

Message ID 20230415101158.1648486-5-cuigaosheng1@huawei.com
State New
Headers show
Series Fix built-in testing dependency failures | expand

Commit Message

Gaosheng Cui April 15, 2023, 10:11 a.m. UTC
From: Herbert Xu <herbert@gondor.apana.org.au>

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: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 crypto/algapi.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/crypto/algapi.c b/crypto/algapi.c
index f6481cb79946..0d0c3e937e36 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -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);