diff options
Diffstat (limited to 'crypto/algapi.c')
| -rw-r--r-- | crypto/algapi.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 395b082d03a9..2a0271b5f62a 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
| @@ -543,9 +543,6 @@ int crypto_register_instance(struct crypto_template *tmpl, | |||
| 543 | inst->alg.cra_module = tmpl->module; | 543 | inst->alg.cra_module = tmpl->module; |
| 544 | inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE; | 544 | inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE; |
| 545 | 545 | ||
| 546 | if (unlikely(!crypto_mod_get(&inst->alg))) | ||
| 547 | return -EAGAIN; | ||
| 548 | |||
| 549 | down_write(&crypto_alg_sem); | 546 | down_write(&crypto_alg_sem); |
| 550 | 547 | ||
| 551 | larval = __crypto_register_alg(&inst->alg); | 548 | larval = __crypto_register_alg(&inst->alg); |
| @@ -563,14 +560,9 @@ unlock: | |||
| 563 | goto err; | 560 | goto err; |
| 564 | 561 | ||
| 565 | crypto_wait_for_test(larval); | 562 | crypto_wait_for_test(larval); |
| 566 | |||
| 567 | /* Remove instance if test failed */ | ||
| 568 | if (!(inst->alg.cra_flags & CRYPTO_ALG_TESTED)) | ||
| 569 | crypto_unregister_instance(inst); | ||
| 570 | err = 0; | 563 | err = 0; |
| 571 | 564 | ||
| 572 | err: | 565 | err: |
| 573 | crypto_mod_put(&inst->alg); | ||
| 574 | return err; | 566 | return err; |
| 575 | } | 567 | } |
| 576 | EXPORT_SYMBOL_GPL(crypto_register_instance); | 568 | EXPORT_SYMBOL_GPL(crypto_register_instance); |
