aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index f1d0307b1d08..1462c68492ea 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -64,6 +64,8 @@ static int crypto_check_alg(struct crypto_alg *alg)
64 if (alg->cra_priority < 0) 64 if (alg->cra_priority < 0)
65 return -EINVAL; 65 return -EINVAL;
66 66
67 atomic_set(&alg->cra_refcnt, 1);
68
67 return crypto_set_driver_name(alg); 69 return crypto_set_driver_name(alg);
68} 70}
69 71
@@ -187,7 +189,6 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
187 189
188 ret = -EEXIST; 190 ret = -EEXIST;
189 191
190 atomic_set(&alg->cra_refcnt, 1);
191 list_for_each_entry(q, &crypto_alg_list, cra_list) { 192 list_for_each_entry(q, &crypto_alg_list, cra_list) {
192 if (q == alg) 193 if (q == alg)
193 goto err; 194 goto err;