Skip to content

Commit 0edf859

Browse files
ebiggersherbertx
authored andcommitted
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>
1 parent 0a877e3 commit 0edf859

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

‎drivers/crypto/cavium/cpt/cptvf_algs.c‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <crypto/aes.h>
1111
#include <crypto/algapi.h>
1212
#include <crypto/authenc.h>
13-
#include <crypto/cryptd.h>
1413
#include <crypto/crypto_wq.h>
1514
#include <crypto/des.h>
1615
#include <crypto/xts.h>
@@ -356,16 +355,7 @@ static int cvm_ecb_des3_setkey(struct crypto_ablkcipher *cipher, const u8 *key,
356355

357356
static int cvm_enc_dec_init(struct crypto_tfm *tfm)
358357
{
359-
struct cvm_enc_ctx *ctx = crypto_tfm_ctx(tfm);
360-
361-
memset(ctx, 0, sizeof(*ctx));
362-
tfm->crt_ablkcipher.reqsize = sizeof(struct cvm_req_ctx) +
363-
sizeof(struct ablkcipher_request);
364-
/* Additional memory for ablkcipher_request is
365-
* allocated since the cryptd daemon uses
366-
* this memory for request_ctx information
367-
*/
368-
358+
tfm->crt_ablkcipher.reqsize = sizeof(struct cvm_req_ctx);
369359
return 0;
370360
}
371361

0 commit comments

Comments
 (0)