X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=crypto%2Falgapi.c;h=56c62e2858d56a9eee11b9167fe8362a71a7c6c1;hb=ed36604b25023c584fdf93df6073f65dac4b1129;hp=7c41e7405c41a4392791cc4a01a22cce52f983b0;hpb=0ff555192a8d20385d49d1c420e2e8d409b3c0da;p=mv-sheeva.git diff --git a/crypto/algapi.c b/crypto/algapi.c index 7c41e7405c4..56c62e2858d 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -149,6 +149,9 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) if (q == alg) goto err; + if (crypto_is_moribund(q)) + continue; + if (crypto_is_larval(q)) { if (!strcmp(alg->cra_driver_name, q->cra_driver_name)) goto err; @@ -197,7 +200,7 @@ void crypto_alg_tested(const char *name, int err) down_write(&crypto_alg_sem); list_for_each_entry(q, &crypto_alg_list, cra_list) { - if (!crypto_is_larval(q)) + if (crypto_is_moribund(q) || !crypto_is_larval(q)) continue; test = (struct crypto_larval *)q; @@ -210,6 +213,7 @@ void crypto_alg_tested(const char *name, int err) goto unlock; found: + q->cra_flags |= CRYPTO_ALG_DEAD; alg = test->adult; if (err || list_empty(&alg->cra_list)) goto complete;