diff options
Diffstat (limited to 'crypto/cryptd.c')
-rw-r--r-- | crypto/cryptd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/cryptd.c b/crypto/cryptd.c index cf8037a87b2d..0c654e59f215 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c | |||
@@ -631,9 +631,14 @@ static int cryptd_hash_export(struct ahash_request *req, void *out) | |||
631 | 631 | ||
632 | static int cryptd_hash_import(struct ahash_request *req, const void *in) | 632 | static int cryptd_hash_import(struct ahash_request *req, const void *in) |
633 | { | 633 | { |
634 | struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); | 634 | struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); |
635 | struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); | ||
636 | struct shash_desc *desc = cryptd_shash_desc(req); | ||
637 | |||
638 | desc->tfm = ctx->child; | ||
639 | desc->flags = req->base.flags; | ||
635 | 640 | ||
636 | return crypto_shash_import(&rctx->desc, in); | 641 | return crypto_shash_import(desc, in); |
637 | } | 642 | } |
638 | 643 | ||
639 | static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, | 644 | static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, |
@@ -733,13 +738,14 @@ static void cryptd_aead_crypt(struct aead_request *req, | |||
733 | rctx = aead_request_ctx(req); | 738 | rctx = aead_request_ctx(req); |
734 | compl = rctx->complete; | 739 | compl = rctx->complete; |
735 | 740 | ||
741 | tfm = crypto_aead_reqtfm(req); | ||
742 | |||
736 | if (unlikely(err == -EINPROGRESS)) | 743 | if (unlikely(err == -EINPROGRESS)) |
737 | goto out; | 744 | goto out; |
738 | aead_request_set_tfm(req, child); | 745 | aead_request_set_tfm(req, child); |
739 | err = crypt( req ); | 746 | err = crypt( req ); |
740 | 747 | ||
741 | out: | 748 | out: |
742 | tfm = crypto_aead_reqtfm(req); | ||
743 | ctx = crypto_aead_ctx(tfm); | 749 | ctx = crypto_aead_ctx(tfm); |
744 | refcnt = atomic_read(&ctx->refcnt); | 750 | refcnt = atomic_read(&ctx->refcnt); |
745 | 751 | ||