summaryrefslogtreecommitdiff
path: root/crypto/api.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2021-10-19 21:28:02 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-10-29 21:04:02 +0800
commit4e06ebe1bef007926a43db35893928299c2be88f (patch)
tree4fd0ecac66d3e5cc1edcb92ba45a807049b42987 /crypto/api.c
parente3804e630b83b9f8f51a42690f63c407c1bc4c11 (diff)
downloadlinux-crypto-4e06ebe1bef007926a43db35893928299c2be88f.tar.gz
linux-crypto-4e06ebe1bef007926a43db35893928299c2be88f.zip
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 <nathan@kernel.org> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Reported-by: kernel test robot <lkp@intel.com> Fixes: f91796cf71a5 ("crypto: api - Fix built-in testing dependency failures") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/api.c b/crypto/api.c
index ee5991fe..cf0869dd 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);