X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=crypto%2Falgapi.c;h=49e126803c7913b47254ee81f14443dfd672b963;hp=2f1954885ff9882b86b693c27afb29ee48a643b7;hb=0f8388e5735898d5bf0a1615c812ed59f268dca9;hpb=3535183db06e2c7729ab145b55e80d570c098940 diff --git a/crypto/algapi.c b/crypto/algapi.c index 2f1954885ff9..49e126803c79 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -163,6 +163,18 @@ void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, spawn->alg = NULL; spawns = &inst->alg.cra_users; + + /* + * We may encounter an unregistered instance here, since + * an instance's spawns are set up prior to the instance + * being registered. An unregistered instance will have + * NULL ->cra_users.next, since ->cra_users isn't + * properly initialized until registration. But an + * unregistered instance cannot have any users, so treat + * it the same as ->cra_users being empty. + */ + if (spawns->next == NULL) + break; } } while ((spawns = crypto_more_spawns(alg, &stack, &top, &secondary_spawns)));