summaryrefslogtreecommitdiffstats
path: root/crypto/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac.c')
-rw-r--r--crypto/hmac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c
index 0a42b7075763..e38bfb948278 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -224,10 +224,12 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
inst->alg.init_tfm = hmac_init_tfm;
inst->alg.exit_tfm = hmac_exit_tfm;
+ 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;
}
@@ -235,7 +237,6 @@ err_free_inst:
static struct crypto_template hmac_tmpl = {
.name = "hmac",
.create = hmac_create,
- .free = shash_free_instance,
.module = THIS_MODULE,
};