diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-09 11:52:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-09 11:52:02 -0500 |
commit | d7c41b616518457e3bfece12e3f59f15d7450eeb (patch) | |
tree | 0c4031ec93d59176d5ce1aa4a296be5a0784f14f /crypto/algapi.c | |
parent | a8e807f7607ab633de7be4e2f4c350923cc2cb63 (diff) | |
parent | 4f3e797ad07d52d34983354a77b365dfcd48c1b4 (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: scatterwalk - Avoid flush_dcache_page on slab pages
crypto: shash - Fix tfm destruction
crypto: api - Fix zeroing on free
crypto: shash - Fix module refcount
crypto: api - Fix algorithm test race that broke aead initialisation
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r-- | crypto/algapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 7c41e7405c41..56c62e2858d5 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -149,6 +149,9 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) | |||
149 | if (q == alg) | 149 | if (q == alg) |
150 | goto err; | 150 | goto err; |
151 | 151 | ||
152 | if (crypto_is_moribund(q)) | ||
153 | continue; | ||
154 | |||
152 | if (crypto_is_larval(q)) { | 155 | if (crypto_is_larval(q)) { |
153 | if (!strcmp(alg->cra_driver_name, q->cra_driver_name)) | 156 | if (!strcmp(alg->cra_driver_name, q->cra_driver_name)) |
154 | goto err; | 157 | goto err; |
@@ -197,7 +200,7 @@ void crypto_alg_tested(const char *name, int err) | |||
197 | 200 | ||
198 | down_write(&crypto_alg_sem); | 201 | down_write(&crypto_alg_sem); |
199 | list_for_each_entry(q, &crypto_alg_list, cra_list) { | 202 | list_for_each_entry(q, &crypto_alg_list, cra_list) { |
200 | if (!crypto_is_larval(q)) | 203 | if (crypto_is_moribund(q) || !crypto_is_larval(q)) |
201 | continue; | 204 | continue; |
202 | 205 | ||
203 | test = (struct crypto_larval *)q; | 206 | test = (struct crypto_larval *)q; |
@@ -210,6 +213,7 @@ void crypto_alg_tested(const char *name, int err) | |||
210 | goto unlock; | 213 | goto unlock; |
211 | 214 | ||
212 | found: | 215 | found: |
216 | q->cra_flags |= CRYPTO_ALG_DEAD; | ||
213 | alg = test->adult; | 217 | alg = test->adult; |
214 | if (err || list_empty(&alg->cra_list)) | 218 | if (err || list_empty(&alg->cra_list)) |
215 | goto complete; | 219 | goto complete; |