aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 735fdedd8217..c11ec1fd4f18 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -267,13 +267,13 @@ int crypto_register_alg(struct crypto_alg *alg)
267 down_write(&crypto_alg_sem); 267 down_write(&crypto_alg_sem);
268 268
269 list_for_each_entry(q, &crypto_alg_list, cra_list) { 269 list_for_each_entry(q, &crypto_alg_list, cra_list) {
270 if (!strcmp(q->cra_driver_name, alg->cra_driver_name)) { 270 if (q == alg) {
271 ret = -EEXIST; 271 ret = -EEXIST;
272 goto out; 272 goto out;
273 } 273 }
274 } 274 }
275 275
276 list_add_tail(&alg->cra_list, &crypto_alg_list); 276 list_add(&alg->cra_list, &crypto_alg_list);
277out: 277out:
278 up_write(&crypto_alg_sem); 278 up_write(&crypto_alg_sem);
279 return ret; 279 return ret;