mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
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 <herbert@gondor.apana.org.au>
This commit is contained in:
10
crypto/api.c
10
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");
|
||||
|
||||
Reference in New Issue
Block a user