aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/cryptd.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-09-08 20:55:21 -0400
committerDan Williams <dan.j.williams@intel.com>2009-09-08 20:55:21 -0400
commitbbb20089a3275a19e475dbc21320c3742e3ca423 (patch)
tree216fdc1cbef450ca688135c5b8969169482d9a48 /crypto/cryptd.c
parent3e48e656903e9fd8bc805c6a2c4264d7808d315b (diff)
parent657a77fa7284d8ae28dfa48f1dc5d919bf5b2843 (diff)
Merge branch 'dmaengine' into async-tx-next
Conflicts: crypto/async_tx/async_xor.c drivers/dma/ioat/dma_v2.h drivers/dma/ioat/pci.c drivers/md/raid5.c
Diffstat (limited to 'crypto/cryptd.c')
-rw-r--r--crypto/cryptd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index d14b22658d7a..ae5fa99d5d36 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -586,20 +586,24 @@ struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
586 u32 type, u32 mask) 586 u32 type, u32 mask)
587{ 587{
588 char cryptd_alg_name[CRYPTO_MAX_ALG_NAME]; 588 char cryptd_alg_name[CRYPTO_MAX_ALG_NAME];
589 struct crypto_ablkcipher *tfm; 589 struct crypto_tfm *tfm;
590 590
591 if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME, 591 if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
592 "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME) 592 "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
593 return ERR_PTR(-EINVAL); 593 return ERR_PTR(-EINVAL);
594 tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask); 594 type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
595 type |= CRYPTO_ALG_TYPE_BLKCIPHER;
596 mask &= ~CRYPTO_ALG_TYPE_MASK;
597 mask |= (CRYPTO_ALG_GENIV | CRYPTO_ALG_TYPE_BLKCIPHER_MASK);
598 tfm = crypto_alloc_base(cryptd_alg_name, type, mask);
595 if (IS_ERR(tfm)) 599 if (IS_ERR(tfm))
596 return ERR_CAST(tfm); 600 return ERR_CAST(tfm);
597 if (crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module != THIS_MODULE) { 601 if (tfm->__crt_alg->cra_module != THIS_MODULE) {
598 crypto_free_ablkcipher(tfm); 602 crypto_free_tfm(tfm);
599 return ERR_PTR(-EINVAL); 603 return ERR_PTR(-EINVAL);
600 } 604 }
601 605
602 return __cryptd_ablkcipher_cast(tfm); 606 return __cryptd_ablkcipher_cast(__crypto_ablkcipher_cast(tfm));
603} 607}
604EXPORT_SYMBOL_GPL(cryptd_alloc_ablkcipher); 608EXPORT_SYMBOL_GPL(cryptd_alloc_ablkcipher);
605 609