Merge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linvill...
[deliverable/linux.git] / crypto / algapi.c
index 58cc19164801e0d634e5cc92fee4466b673d42ff..8383282de1ddc39422cd227b7a800a095ad14f67 100644 (file)
@@ -95,6 +95,9 @@ static void crypto_remove_spawn(struct crypto_spawn *spawn,
                return;
 
        inst->alg.cra_flags |= CRYPTO_ALG_DEAD;
+       if (hlist_unhashed(&inst->list))
+               return;
+
        if (!tmpl || !crypto_tmpl_get(tmpl))
                return;
 
@@ -149,6 +152,11 @@ static int __crypto_register_alg(struct crypto_alg *alg,
                if (crypto_is_larval(q)) {
                        struct crypto_larval *larval = (void *)q;
 
+                       /*
+                        * Check to see if either our generic name or
+                        * specific name can satisfy the name requested
+                        * by the larval entry q.
+                        */
                        if (strcmp(alg->cra_name, q->cra_name) &&
                            strcmp(alg->cra_driver_name, q->cra_name))
                                continue;
@@ -330,9 +338,6 @@ int crypto_register_instance(struct crypto_template *tmpl,
        LIST_HEAD(list);
        int err = -EINVAL;
 
-       if (inst->alg.cra_destroy)
-               goto err;
-
        err = crypto_check_alg(&inst->alg);
        if (err)
                goto err;
This page took 0.0239 seconds and 5 git commands to generate.