diff options
| author | Herbert Xu <[email protected]> | 2025-03-09 02:43:12 +0000 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2025-03-15 08:21:22 +0000 |
| commit | 3d6979bf3bd51f47e889327e10e4653d55168c21 (patch) | |
| tree | 0215f74440d2fac509377468f4aa4a9a89af6ba3 /crypto/api.c | |
| parent | crypto: artpec6 - change from kzalloc to kcalloc in artpec6_crypto_probe() (diff) | |
| download | kernel-3d6979bf3bd51f47e889327e10e4653d55168c21.tar.gz kernel-3d6979bf3bd51f47e889327e10e4653d55168c21.zip | |
crypto: api - Add cra_type->destroy hook
Add a cra_type->destroy hook so that resources can be freed after
the last user of a registered algorithm is gone.
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'crypto/api.c')
| -rw-r--r-- | crypto/api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/api.c b/crypto/api.c index c2c4eb14ef95..91957bb52f3f 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -707,5 +707,15 @@ void crypto_req_done(void *data, int err) } EXPORT_SYMBOL_GPL(crypto_req_done); +void crypto_destroy_alg(struct crypto_alg *alg) +{ + if (alg->cra_type && alg->cra_type->destroy) + alg->cra_type->destroy(alg); + + if (alg->cra_destroy) + alg->cra_destroy(alg); +} +EXPORT_SYMBOL_GPL(crypto_destroy_alg); + MODULE_DESCRIPTION("Cryptographic core API"); MODULE_LICENSE("GPL"); |
