Merge tag 'devicetree-for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / crypto / algapi.c
index 395b082d03a92263198e03ef6db1f39df95235ae..2a0271b5f62a253d2b0faa9ccde99026e7bfdb59 100644 (file)
@@ -543,9 +543,6 @@ int crypto_register_instance(struct crypto_template *tmpl,
        inst->alg.cra_module = tmpl->module;
        inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE;
 
-       if (unlikely(!crypto_mod_get(&inst->alg)))
-               return -EAGAIN;
-
        down_write(&crypto_alg_sem);
 
        larval = __crypto_register_alg(&inst->alg);
@@ -563,14 +560,9 @@ unlock:
                goto err;
 
        crypto_wait_for_test(larval);
-
-       /* Remove instance if test failed */
-       if (!(inst->alg.cra_flags & CRYPTO_ALG_TESTED))
-               crypto_unregister_instance(inst);
        err = 0;
 
 err:
-       crypto_mod_put(&inst->alg);
        return err;
 }
 EXPORT_SYMBOL_GPL(crypto_register_instance);