From: Herbert Xu Date: Fri, 5 Nov 2021 07:26:08 +0000 (+0800) Subject: crypto: api - Fix boot-up crash when crypto manager is disabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=beaaaa37c664e9afdf2913aee19185d8e3793b50;p=linux.git 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 Reported-by: Ido Schimmel Reported-by: Guenter Roeck Signed-off-by: Herbert Xu Tested-by: Ido Schimmel Tested-by: Geert Uytterhoeven Signed-off-by: Herbert Xu --- diff --git a/crypto/algapi.c b/crypto/algapi.c index d379fd91fb7b0..a366cb3e8aa18 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);