diff options
Diffstat (limited to 'crypto/api.c')
-rw-r--r-- | crypto/api.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c index 133d9b626922..5724d62e9d07 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -219,10 +219,19 @@ again: if (crypto_is_test_larval(larval)) crypto_larval_kill(larval); alg = ERR_PTR(-ETIMEDOUT); - } else if (!alg) { + } else if (!alg || PTR_ERR(alg) == -EEXIST) { + int err = alg ? -EEXIST : -EAGAIN; + + /* + * EEXIST is expected because two probes can be scheduled + * at the same time with one using alg_name and the other + * using driver_name. Do a re-lookup but do not retry in + * case we hit a quirk like gcm_base(ctr(aes),...) which + * will never match. + */ alg = &larval->alg; alg = crypto_alg_lookup(alg->cra_name, type, mask) ?: - ERR_PTR(-EAGAIN); + ERR_PTR(err); } else if (IS_ERR(alg)) ; else if (crypto_is_test_larval(larval) && |