summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-04-21 13:27:16 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2009-04-21 13:27:16 +0800
commitab67bc48d613b44497f614f63b283de10d43a7ed (patch)
tree4dc49e94ae7606b07b01e085544f02a0506a38a1
parentef4de0a05da9a1edc46593f18754db428a134699 (diff)
downloadlinux-crypto-ab67bc48d613b44497f614f63b283de10d43a7ed.tar.gz
linux-crypto-ab67bc48d613b44497f614f63b283de10d43a7ed.zip
crypto: api - Fix algorithm module auto-loading
The commit 89dd1d477cb68a6fb936b97560e1f85191b50d39 (crypto: api - Fix module load deadlock with fallback algorithms) broke the auto-loading of algorithms that require fallbacks. The problem is that the fallback mask check is missing an and which cauess bits that should be considered to interfere with the result. Reported-by: Chuck Ebbert <cebbert@redhat.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 314dab96..fd2545de 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -221,7 +221,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
request_module(name);
- if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
+ if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
+ CRYPTO_ALG_NEED_FALLBACK) &&
snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
request_module(tmp);