Skip to content

Commit

Permalink
[CRYPTO] api: Wake up all waiters when larval completes
Browse files Browse the repository at this point in the history
Right now when a larval matures or when it dies of an error we
only wake up one waiter.  This would cause other waiters to timeout
unnecessarily.  This patch changes it to use complete_all to wake
up all waiters.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jul 11, 2007
1 parent 2e290f4 commit fe3c520
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void crypto_larval_error(const char *name, u32 type, u32 mask)
if (alg) {
if (crypto_is_larval(alg)) {
struct crypto_larval *larval = (void *)alg;
complete(&larval->completion);
complete_all(&larval->completion);
}
crypto_mod_put(alg);
}
Expand Down Expand Up @@ -164,7 +164,7 @@ static int __crypto_register_alg(struct crypto_alg *alg,
continue;

larval->adult = alg;
complete(&larval->completion);
complete_all(&larval->completion);
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void crypto_larval_kill(struct crypto_alg *alg)
down_write(&crypto_alg_sem);
list_del(&alg->cra_list);
up_write(&crypto_alg_sem);
complete(&larval->completion);
complete_all(&larval->completion);
crypto_alg_put(alg);
}

Expand Down

0 comments on commit fe3c520

Please sign in to comment.