summaryrefslogtreecommitdiff
path: root/crypto/ablkcipher.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-23 15:41:48 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-05-25 18:41:28 +0800
commite9c651d150c8671bbbaf1d4dc55346c3eecbdff0 (patch)
tree30bf2d82e7480363c384a6eda232d359f34fd8eb /crypto/ablkcipher.c
parente17a5cfe0ff226cad9791e910f70d7863ae88830 (diff)
downloadlinux-crypto-e9c651d150c8671bbbaf1d4dc55346c3eecbdff0.tar.gz
linux-crypto-e9c651d150c8671bbbaf1d4dc55346c3eecbdff0.zip
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>
Diffstat (limited to 'crypto/ablkcipher.c')
-rw-r--r--crypto/ablkcipher.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index b3dded45..b15d797f 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -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;