diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-03 20:05:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-03 20:05:08 -0500 |
commit | 9c1a7747059a65dbc2d7703978841a37db699fbf (patch) | |
tree | 7bbbad1430fa70bcf1c4daaba7dd1dc88306c3b8 /crypto/api.c | |
parent | 219f170a85fee524fa528ef75a0432b79af95d0b (diff) | |
parent | 1777f1a978153e8b887c1e1eb5160ac46098b142 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: ixp4xx - Fix qmgr_request_queue build failure
crypto: api - Fix module load deadlock with fallback algorithms
Diffstat (limited to 'crypto/api.c')
-rw-r--r-- | crypto/api.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c index efe77df6863f..38a2bc02a98c 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -215,8 +215,19 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) | |||
215 | mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); | 215 | mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); |
216 | type &= mask; | 216 | type &= mask; |
217 | 217 | ||
218 | alg = try_then_request_module(crypto_alg_lookup(name, type, mask), | 218 | alg = crypto_alg_lookup(name, type, mask); |
219 | name); | 219 | if (!alg) { |
220 | char tmp[CRYPTO_MAX_ALG_NAME]; | ||
221 | |||
222 | request_module(name); | ||
223 | |||
224 | if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) && | ||
225 | snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp)) | ||
226 | request_module(tmp); | ||
227 | |||
228 | alg = crypto_alg_lookup(name, type, mask); | ||
229 | } | ||
230 | |||
220 | if (alg) | 231 | if (alg) |
221 | return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg; | 232 | return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg; |
222 | 233 | ||