summaryrefslogtreecommitdiff
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-03-17 16:33:57 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-07 13:22:25 +0800
commit138804c2c18ca8bd1443dea173b3cc2643995919 (patch)
treef115ea67cd14f704d971fd753ca3c54b9ba9239d /crypto/internal.h
parent3860642e0a87c8aef3c4285f3bb4ad473cfd514f (diff)
downloadlinux-138804c2c18ca8bd1443dea173b3cc2643995919.tar.gz
linux-138804c2c18ca8bd1443dea173b3cc2643995919.tar.bz2
linux-138804c2c18ca8bd1443dea173b3cc2643995919.zip
crypto: api - Ensure cra_type->destroy is done in process context
Move the cra_type->destroy call out of crypto_alg_put and into crypto_unregister_alg and crypto_free_instance. This ensures that it's always done in process context so calls such as flush_work can be done. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 11567ea24fc3..2edefb546ad4 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -128,7 +128,6 @@ void *crypto_create_tfm_node(struct crypto_alg *alg,
const struct crypto_type *frontend, int node);
void *crypto_clone_tfm(const struct crypto_type *frontend,
struct crypto_tfm *otfm);
-void crypto_destroy_alg(struct crypto_alg *alg);
static inline void *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend)
@@ -166,7 +165,7 @@ static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg)
static inline void crypto_alg_put(struct crypto_alg *alg)
{
if (refcount_dec_and_test(&alg->cra_refcnt))
- crypto_destroy_alg(alg);
+ alg->cra_destroy(alg);
}
static inline int crypto_tmpl_get(struct crypto_template *tmpl)