mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
crypto: skcipher - 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: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
622ff87527
commit
56e34378bb
1 changed files with 8 additions and 0 deletions
|
@ -586,6 +586,13 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
|
|||
if (!tmpl)
|
||||
goto kill_larval;
|
||||
|
||||
if (tmpl->create) {
|
||||
err = tmpl->create(tmpl, tb);
|
||||
if (err)
|
||||
goto put_tmpl;
|
||||
goto ok;
|
||||
}
|
||||
|
||||
inst = tmpl->alloc(tb);
|
||||
err = PTR_ERR(inst);
|
||||
if (IS_ERR(inst))
|
||||
|
@ -597,6 +604,7 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
|
|||
goto put_tmpl;
|
||||
}
|
||||
|
||||
ok:
|
||||
/* Redo the lookup to use the instance we just registered. */
|
||||
err = -EAGAIN;
|
||||
|
||||
|
|
Loading…
Reference in a new issue