Skip to content

Commit

Permalink
[CRYPTO] api: Allow replacement when registering new algorithms
Browse files Browse the repository at this point in the history
We already allow asynchronous removal of existing algorithm modules.  By
allowing the replacement of existing algorithms, we can replace algorithms
without having to wait for for all existing users to complete.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jun 26, 2006
1 parent d913ea0 commit 996e252
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ int crypto_register_alg(struct crypto_alg *alg)
down_write(&crypto_alg_sem);

list_for_each_entry(q, &crypto_alg_list, cra_list) {
if (!strcmp(q->cra_driver_name, alg->cra_driver_name)) {
if (q == alg) {
ret = -EEXIST;
goto out;
}
}

list_add_tail(&alg->cra_list, &crypto_alg_list);
list_add(&alg->cra_list, &crypto_alg_list);
out:
up_write(&crypto_alg_sem);
return ret;
Expand Down

0 comments on commit 996e252

Please sign in to comment.