Merge tag 'for-5.6/io_uring-vfs-2020-01-29' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / crypto / geniv.c
index b9e45a2..dbcc640 100644 (file)
@@ -32,6 +32,12 @@ static int aead_geniv_setauthsize(struct crypto_aead *tfm,
        return crypto_aead_setauthsize(ctx->child, authsize);
 }
 
+static void aead_geniv_free(struct aead_instance *inst)
+{
+       crypto_drop_aead(aead_instance_ctx(inst));
+       kfree(inst);
+}
+
 struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
                                       struct rtattr **tb, u32 type, u32 mask)
 {
@@ -64,8 +70,8 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
        /* Ignore async algorithms if necessary. */
        mask |= crypto_requires_sync(algt->type, algt->mask);
 
-       crypto_set_aead_spawn(spawn, aead_crypto_instance(inst));
-       err = crypto_grab_aead(spawn, name, type, mask);
+       err = crypto_grab_aead(spawn, aead_crypto_instance(inst),
+                              name, type, mask);
        if (err)
                goto err_free_inst;
 
@@ -100,6 +106,8 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
        inst->alg.ivsize = ivsize;
        inst->alg.maxauthsize = maxauthsize;
 
+       inst->free = aead_geniv_free;
+
 out:
        return inst;
 
@@ -112,13 +120,6 @@ err_free_inst:
 }
 EXPORT_SYMBOL_GPL(aead_geniv_alloc);
 
-void aead_geniv_free(struct aead_instance *inst)
-{
-       crypto_drop_aead(aead_instance_ctx(inst));
-       kfree(inst);
-}
-EXPORT_SYMBOL_GPL(aead_geniv_free);
-
 int aead_init_geniv(struct crypto_aead *aead)
 {
        struct aead_geniv_ctx *ctx = crypto_aead_ctx(aead);