summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/adiantum.c6
-rw-r--r--crypto/aead.c3
-rw-r--r--crypto/akcipher.c3
-rw-r--r--crypto/algapi.c6
-rw-r--r--crypto/skcipher.c3
5 files changed, 9 insertions, 12 deletions
diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index 567071464fab..76a41881ee8c 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -542,9 +542,9 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb)
streamcipher_alg = crypto_spawn_skcipher_alg(&ictx->streamcipher_spawn);
/* Block cipher, e.g. "aes" */
- crypto_set_spawn(&ictx->blockcipher_spawn,
- skcipher_crypto_instance(inst));
- err = crypto_grab_spawn(&ictx->blockcipher_spawn, blockcipher_name,
+ err = crypto_grab_spawn(&ictx->blockcipher_spawn,
+ skcipher_crypto_instance(inst),
+ blockcipher_name,
CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK);
if (err)
goto out_drop_streamcipher;
diff --git a/crypto/aead.c b/crypto/aead.c
index c7135e00b8ea..02a0db076d7e 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -211,9 +211,8 @@ int crypto_grab_aead(struct crypto_aead_spawn *spawn,
struct crypto_instance *inst,
const char *name, u32 type, u32 mask)
{
- spawn->base.inst = inst;
spawn->base.frontend = &crypto_aead_type;
- return crypto_grab_spawn(&spawn->base, name, type, mask);
+ return crypto_grab_spawn(&spawn->base, inst, name, type, mask);
}
EXPORT_SYMBOL_GPL(crypto_grab_aead);
diff --git a/crypto/akcipher.c b/crypto/akcipher.c
index 84ccf9b02bbe..eeed6c151d2f 100644
--- a/crypto/akcipher.c
+++ b/crypto/akcipher.c
@@ -94,9 +94,8 @@ int crypto_grab_akcipher(struct crypto_akcipher_spawn *spawn,
struct crypto_instance *inst,
const char *name, u32 type, u32 mask)
{
- spawn->base.inst = inst;
spawn->base.frontend = &crypto_akcipher_type;
- return crypto_grab_spawn(&spawn->base, name, type, mask);
+ return crypto_grab_spawn(&spawn->base, inst, name, type, mask);
}
EXPORT_SYMBOL_GPL(crypto_grab_akcipher);
diff --git a/crypto/algapi.c b/crypto/algapi.c
index a5223c5f2275..a25ce02918f8 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -714,8 +714,8 @@ out:
}
EXPORT_SYMBOL_GPL(crypto_init_spawn2);
-int crypto_grab_spawn(struct crypto_spawn *spawn, const char *name,
- u32 type, u32 mask)
+int crypto_grab_spawn(struct crypto_spawn *spawn, struct crypto_instance *inst,
+ const char *name, u32 type, u32 mask)
{
struct crypto_alg *alg;
int err;
@@ -729,7 +729,7 @@ int crypto_grab_spawn(struct crypto_spawn *spawn, const char *name,
return PTR_ERR(alg);
spawn->dropref = true;
- err = crypto_init_spawn(spawn, alg, spawn->inst, mask);
+ err = crypto_init_spawn(spawn, alg, inst, mask);
if (err)
crypto_mod_put(alg);
return err;
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index 8759d473a154..15c033c960f7 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -750,9 +750,8 @@ int crypto_grab_skcipher(struct crypto_skcipher_spawn *spawn,
struct crypto_instance *inst,
const char *name, u32 type, u32 mask)
{
- spawn->base.inst = inst;
spawn->base.frontend = &crypto_skcipher_type;
- return crypto_grab_spawn(&spawn->base, name, type, mask);
+ return crypto_grab_spawn(&spawn->base, inst, name, type, mask);
}
EXPORT_SYMBOL_GPL(crypto_grab_skcipher);