diff options
author | Eric Biggers <ebiggers@google.com> | 2019-04-12 21:25:31 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-04-18 22:15:04 +0800 |
commit | 0edf8593eb0985c88aa668b00befcdc1183d004d (patch) | |
tree | 0a4ab720a812938442bde197429b5b8ad183b353 /drivers/crypto/cavium | |
parent | 0a877e354a2c09435c8aea3fd2188cdef3c149f7 (diff) | |
download | linux-0edf8593eb0985c88aa668b00befcdc1183d004d.tar.gz linux-0edf8593eb0985c88aa668b00befcdc1183d004d.tar.bz2 linux-0edf8593eb0985c88aa668b00befcdc1183d004d.zip |
crypto: cavium - remove bogus code handling cryptd
The cavium crypto driver adds 'sizeof(struct ablkcipher_request)' to its
request size because "the cryptd daemon uses this memory for request_ctx
information". This is incorrect and unnecessary; cryptd doesn't require
wrapped algorithms to reserve extra request space. So remove this.
Also remove the unneeded memset() of the tfm context to 0.
It's already zeroed on allocation.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/cavium')
-rw-r--r-- | drivers/crypto/cavium/cpt/cptvf_algs.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/crypto/cavium/cpt/cptvf_algs.c b/drivers/crypto/cavium/cpt/cptvf_algs.c index 8cffe6094270..9810ad8ac519 100644 --- a/drivers/crypto/cavium/cpt/cptvf_algs.c +++ b/drivers/crypto/cavium/cpt/cptvf_algs.c @@ -10,7 +10,6 @@ #include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/authenc.h> -#include <crypto/cryptd.h> #include <crypto/crypto_wq.h> #include <crypto/des.h> #include <crypto/xts.h> @@ -356,16 +355,7 @@ static int cvm_ecb_des3_setkey(struct crypto_ablkcipher *cipher, const u8 *key, static int cvm_enc_dec_init(struct crypto_tfm *tfm) { - struct cvm_enc_ctx *ctx = crypto_tfm_ctx(tfm); - - memset(ctx, 0, sizeof(*ctx)); - tfm->crt_ablkcipher.reqsize = sizeof(struct cvm_req_ctx) + - sizeof(struct ablkcipher_request); - /* Additional memory for ablkcipher_request is - * allocated since the cryptd daemon uses - * this memory for request_ctx information - */ - + tfm->crt_ablkcipher.reqsize = sizeof(struct cvm_req_ctx); return 0; } |