Commit 72af865d authored by Herbert Xu's avatar Herbert Xu

crypto: aead - Use tmpl->create

Newer templates use tmpl->create and have a NULL tmpl->alloc.  So
we must use tmpl->create if it is set.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 56e34378
...@@ -572,6 +572,13 @@ static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask) ...@@ -572,6 +572,13 @@ static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
if (!tmpl) if (!tmpl)
goto kill_larval; goto kill_larval;
if (tmpl->create) {
err = tmpl->create(tmpl, tb);
if (err)
goto put_tmpl;
goto ok;
}
inst = tmpl->alloc(tb); inst = tmpl->alloc(tb);
err = PTR_ERR(inst); err = PTR_ERR(inst);
if (IS_ERR(inst)) if (IS_ERR(inst))
...@@ -583,6 +590,7 @@ static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask) ...@@ -583,6 +590,7 @@ static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
goto put_tmpl; goto put_tmpl;
} }
ok:
/* Redo the lookup to use the instance we just registered. */ /* Redo the lookup to use the instance we just registered. */
err = -EAGAIN; err = -EAGAIN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment