projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
622ff87
)
crypto: skcipher - Use tmpl->create
author
Herbert Xu
<herbert@gondor.apana.org.au>
Sat, 23 May 2015 07:41:48 +0000
(15:41 +0800)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Mon, 25 May 2015 10:41:28 +0000
(18:41 +0800)
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>
crypto/ablkcipher.c
patch
|
blob
|
blame
|
history
diff --git
a/crypto/ablkcipher.c
b/crypto/ablkcipher.c
index b3dded4558c138e49aebb35a4475e2ac0d7d0214..b15d797f94f9a5861fff55c12520ea4645c3df70 100644
(file)
--- 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;