From cad439fc040efe5f4381e3a7d583c5c200dbc186 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 19 Oct 2021 21:28:02 +0800 Subject: crypto: api - Do not create test larvals if manager is disabled The delayed boot-time testing patch created a dependency loop between api.c and algapi.c because it added a crypto_alg_tested call to the former when the crypto manager is disabled. We could instead avoid creating the test larvals if the crypto manager is disabled. This avoids the dependency loop as well as saving some unnecessary work, albeit in a very unlikely case. Reported-by: Nathan Chancellor Reported-by: Naresh Kamboju Reported-by: kernel test robot Fixes: adad556efcdd ("crypto: api - Fix built-in testing dependency failures") Signed-off-by: Herbert Xu --- crypto/api.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crypto/api.c') diff --git a/crypto/api.c b/crypto/api.c index ee5991fe11f8..cf0869dd130b 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -167,11 +167,8 @@ void crypto_wait_for_test(struct crypto_larval *larval) int err; err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult); - if (err != NOTIFY_STOP) { - if (WARN_ON(err != NOTIFY_DONE)) - goto out; - crypto_alg_tested(larval->alg.cra_driver_name, 0); - } + if (WARN_ON_ONCE(err != NOTIFY_STOP)) + goto out; err = wait_for_completion_killable(&larval->completion); WARN_ON(err); -- cgit v1.2.3-59-g8ed1b