Merge tag 'tomoyo-pr-20200128' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1
[linux-2.6-microblaze.git] / crypto / ccm.c
index f4abaef..241ecdc 100644 (file)
@@ -927,10 +927,12 @@ static int cbcmac_create(struct crypto_template *tmpl, struct rtattr **tb)
        inst->alg.final = crypto_cbcmac_digest_final;
        inst->alg.setkey = crypto_cbcmac_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;
 }
@@ -939,7 +941,6 @@ static struct crypto_template crypto_ccm_tmpls[] = {
        {
                .name = "cbcmac",
                .create = cbcmac_create,
-               .free = shash_free_instance,
                .module = THIS_MODULE,
        }, {
                .name = "ccm_base",