summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/cryptd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index 22ba81f76764..2f833dcc1711 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -688,16 +688,18 @@ static void cryptd_aead_crypt(struct aead_request *req,
688 int (*crypt)(struct aead_request *req)) 688 int (*crypt)(struct aead_request *req))
689{ 689{
690 struct cryptd_aead_request_ctx *rctx; 690 struct cryptd_aead_request_ctx *rctx;
691 crypto_completion_t compl;
692
691 rctx = aead_request_ctx(req); 693 rctx = aead_request_ctx(req);
694 compl = rctx->complete;
692 695
693 if (unlikely(err == -EINPROGRESS)) 696 if (unlikely(err == -EINPROGRESS))
694 goto out; 697 goto out;
695 aead_request_set_tfm(req, child); 698 aead_request_set_tfm(req, child);
696 err = crypt( req ); 699 err = crypt( req );
697 req->base.complete = rctx->complete;
698out: 700out:
699 local_bh_disable(); 701 local_bh_disable();
700 rctx->complete(&req->base, err); 702 compl(&req->base, err);
701 local_bh_enable(); 703 local_bh_enable();
702} 704}
703 705
@@ -756,7 +758,9 @@ static int cryptd_aead_init_tfm(struct crypto_aead *tfm)
756 return PTR_ERR(cipher); 758 return PTR_ERR(cipher);
757 759
758 ctx->child = cipher; 760 ctx->child = cipher;
759 crypto_aead_set_reqsize(tfm, sizeof(struct cryptd_aead_request_ctx)); 761 crypto_aead_set_reqsize(
762 tfm, max((unsigned)sizeof(struct cryptd_aead_request_ctx),
763 crypto_aead_reqsize(cipher)));
760 return 0; 764 return 0;
761} 765}
762 766
@@ -775,7 +779,7 @@ static int cryptd_create_aead(struct crypto_template *tmpl,
775 struct aead_alg *alg; 779 struct aead_alg *alg;
776 const char *name; 780 const char *name;
777 u32 type = 0; 781 u32 type = 0;
778 u32 mask = 0; 782 u32 mask = CRYPTO_ALG_ASYNC;
779 int err; 783 int err;
780 784
781 cryptd_check_internal(tb, &type, &mask); 785 cryptd_check_internal(tb, &type, &mask);