summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-05-21 11:57:20 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2006-06-26 17:34:41 +1000
commit7b5264b62cfe67561b6936aeabe4e48cb649a17c (patch)
treecd578d72945c1226fc85783eeea0227a7e3abf6a
parent3ed0a79b2a4443f3cd68c67e3c69c1300105a0e1 (diff)
downloadlinux-crypto-7b5264b62cfe67561b6936aeabe4e48cb649a17c.tar.gz
linux-crypto-7b5264b62cfe67561b6936aeabe4e48cb649a17c.zip
[CRYPTO] api: Allow replacement when registering new algorithms
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 <herbert@gondor.apana.org.au>
-rw-r--r--crypto/api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 735fdedd..c11ec1fd 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -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;