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)  static int cryptd_hash_import(struct ahash_request *req, const void *in)  { -	struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); +	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); +	struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); +	struct shash_desc *desc = cryptd_shash_desc(req); + +	desc->tfm = ctx->child; +	desc->flags = req->base.flags; -	return crypto_shash_import(&rctx->desc, in); +	return crypto_shash_import(desc, in);  }  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,  	rctx = aead_request_ctx(req);  	compl = rctx->complete; +	tfm = crypto_aead_reqtfm(req); +  	if (unlikely(err == -EINPROGRESS))  		goto out;  	aead_request_set_tfm(req, child);  	err = crypt( req );  out: -	tfm = crypto_aead_reqtfm(req);  	ctx = crypto_aead_ctx(tfm);  	refcnt = atomic_read(&ctx->refcnt);  | 
