mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
crypto: shash - convert shash_free_instance() to new style
Convert shash_free_instance() and its users to the new way of freeing instances, where a ->free() method is installed to the instance struct itself. This replaces the weakly-typed method crypto_template::free(). This will allow removing support for the old way of freeing instances. Also give shash_free_instance() a more descriptive name to reflect that it's only for instances with a single spawn, not for any instance. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -239,10 +239,12 @@ static int xcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
|
||||
inst->alg.final = crypto_xcbc_digest_final;
|
||||
inst->alg.setkey = crypto_xcbc_digest_setkey;
|
||||
|
||||
inst->free = shash_free_singlespawn_instance;
|
||||
|
||||
err = shash_register_instance(tmpl, inst);
|
||||
if (err) {
|
||||
err_free_inst:
|
||||
shash_free_instance(shash_crypto_instance(inst));
|
||||
shash_free_singlespawn_instance(inst);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@@ -250,7 +252,6 @@ err_free_inst:
|
||||
static struct crypto_template crypto_xcbc_tmpl = {
|
||||
.name = "xcbc",
|
||||
.create = xcbc_create,
|
||||
.free = shash_free_instance,
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user