summaryrefslogtreecommitdiff
path: root/crypto/pcrypt.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-01-18 09:32:15 +1000
committerDave Airlie <airlied@redhat.com>2018-01-18 09:32:15 +1000
commit567eef3a35d08d4bfb49057c9779bce7a66a6908 (patch)
tree2bf17da93b86508fe2f66e87f39897a1d4b403dc /crypto/pcrypt.c
parentbc77326f864263acbf6f8e6ac6be2d647ac9cc78 (diff)
parent21864b027d847a6d91903a5ba219770403ba8aad (diff)
downloadlinux-crypto-567eef3a35d08d4bfb49057c9779bce7a66a6908.tar.gz
linux-crypto-567eef3a35d08d4bfb49057c9779bce7a66a6908.zip
BackMerge tag 'v4.15-rc8' into drm-next
Linux 4.15-rc8 Daniel requested this for so the intel CI won't fall over on drm-next so often.
Diffstat (limited to '')
-rw-r--r--crypto/pcrypt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index ee9cfb99..f8ec3d4b 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -254,6 +254,14 @@ static void pcrypt_aead_exit_tfm(struct crypto_aead *tfm)
crypto_free_aead(ctx->child);
}
+static void pcrypt_free(struct aead_instance *inst)
+{
+ struct pcrypt_instance_ctx *ctx = aead_instance_ctx(inst);
+
+ crypto_drop_aead(&ctx->spawn);
+ kfree(inst);
+}
+
static int pcrypt_init_instance(struct crypto_instance *inst,
struct crypto_alg *alg)
{
@@ -319,6 +327,8 @@ static int pcrypt_create_aead(struct crypto_template *tmpl, struct rtattr **tb,
inst->alg.encrypt = pcrypt_aead_encrypt;
inst->alg.decrypt = pcrypt_aead_decrypt;
+ inst->free = pcrypt_free;
+
err = aead_register_instance(tmpl, inst);
if (err)
goto out_drop_aead;
@@ -349,14 +359,6 @@ static int pcrypt_create(struct crypto_template *tmpl, struct rtattr **tb)
return -EINVAL;
}
-static void pcrypt_free(struct crypto_instance *inst)
-{
- struct pcrypt_instance_ctx *ctx = crypto_instance_ctx(inst);
-
- crypto_drop_aead(&ctx->spawn);
- kfree(inst);
-}
-
static int pcrypt_cpumask_change_notify(struct notifier_block *self,
unsigned long val, void *data)
{
@@ -469,7 +471,6 @@ static void pcrypt_fini_padata(struct padata_pcrypt *pcrypt)
static struct crypto_template pcrypt_tmpl = {
.name = "pcrypt",
.create = pcrypt_create,
- .free = pcrypt_free,
.module = THIS_MODULE,
};