summaryrefslogtreecommitdiffstats
path: root/crypto/pcbc.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-12-17 10:05:58 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2007-02-07 09:21:01 +1100
commit2e306ee016fd4750289e65c3b1856db569f1f3f2 (patch)
tree53ace6081967c640f052d53397250657af855c25 /crypto/pcbc.c
parentf1ddcaf3393b7a3871809b97fae90fac841a1f39 (diff)
downloadlinux-stable-2e306ee016fd4750289e65c3b1856db569f1f3f2.tar.gz
linux-stable-2e306ee016fd4750289e65c3b1856db569f1f3f2.tar.bz2
linux-stable-2e306ee016fd4750289e65c3b1856db569f1f3f2.zip
[CRYPTO] api: Add type-safe spawns
This patch allows spawns of specific types (e.g., cipher) to be allocated. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/pcbc.c')
-rw-r--r--crypto/pcbc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/pcbc.c b/crypto/pcbc.c
index 0ffb46eb259f..5174d7fdad6e 100644
--- a/crypto/pcbc.c
+++ b/crypto/pcbc.c
@@ -247,6 +247,7 @@ static int crypto_pcbc_init_tfm(struct crypto_tfm *tfm)
struct crypto_instance *inst = (void *)tfm->__crt_alg;
struct crypto_spawn *spawn = crypto_instance_ctx(inst);
struct crypto_pcbc_ctx *ctx = crypto_tfm_ctx(tfm);
+ struct crypto_cipher *cipher;
switch (crypto_tfm_alg_blocksize(tfm)) {
case 8:
@@ -264,11 +265,11 @@ static int crypto_pcbc_init_tfm(struct crypto_tfm *tfm)
ctx->xor = xor_quad;
}
- tfm = crypto_spawn_tfm(spawn);
- if (IS_ERR(tfm))
- return PTR_ERR(tfm);
+ cipher = crypto_spawn_cipher(spawn);
+ if (IS_ERR(cipher))
+ return PTR_ERR(cipher);
- ctx->child = crypto_cipher_cast(tfm);
+ ctx->child = cipher;
return 0;
}