The functions crypto_alg_get and crypto_alg_put operates on the crypto
modules rather than the algorithms. Therefore it makes sense to call
them crypto_mod_get and crypto_alg_put respectively.
This is needed because we need to have real algorithm reference counters
for parameterised algorithms as they can be unregistered from below by
when their parameter algorithms are themselves unregistered.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
LIST_HEAD(crypto_alg_list);
DECLARE_RWSEM(crypto_alg_sem);
-static inline int crypto_alg_get(struct crypto_alg *alg)
+static inline int crypto_mod_get(struct crypto_alg *alg)
{
return try_module_get(alg->cra_module);
}
-static inline void crypto_alg_put(struct crypto_alg *alg)
+static inline void crypto_mod_put(struct crypto_alg *alg)
{
module_put(alg->cra_module);
}
if (!exact && !(fuzzy && q->cra_priority > best))
continue;
- if (unlikely(!crypto_alg_get(q)))
+ if (unlikely(!crypto_mod_get(q)))
continue;
best = q->cra_priority;
if (alg)
- crypto_alg_put(alg);
+ crypto_mod_put(alg);
alg = q;
if (exact)
kfree(tfm);
tfm = NULL;
out_put:
- crypto_alg_put(alg);
+ crypto_mod_put(alg);
out:
return tfm;
}
if (alg->cra_exit)
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
- crypto_alg_put(alg);
+ crypto_mod_put(alg);
memset(tfm, 0, size);
kfree(tfm);
}
struct crypto_alg *alg = crypto_alg_mod_lookup(name);
if (alg) {
- crypto_alg_put(alg);
+ crypto_mod_put(alg);
ret = 1;
}