aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <[email protected]>2021-11-05 15:26:08 +0800
committerHerbert Xu <[email protected]>2021-11-09 13:45:48 +0800
commitbeaaaa37c664e9afdf2913aee19185d8e3793b50 (patch)
tree9f1958106c7d99d5c833e44ccb60a34349308aba
parent39ef08517082a424b5b65c3dbaa6c0fa9d3303b9 (diff)
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 <[email protected]> Reported-by: Ido Schimmel <[email protected]> Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Tested-by: Ido Schimmel <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
-rw-r--r--crypto/algapi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index d379fd91fb7b..a366cb3e8aa1 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);