diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-11-30 19:53:12 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-11-30 19:53:12 +0800 |
commit | 479d014de544a0916037fcf77e873f815545cd5e (patch) | |
tree | 6752a8184e2f2696c31ab141576e9902410c6c75 /crypto/algif_hash.c | |
parent | 585b5fa63da92b2d46d5c1735a5c46e9a1486bbe (diff) | |
parent | 57891633eeef60e732e045731cf20e50ee80acb4 (diff) | |
download | op-kernel-dev-479d014de544a0916037fcf77e873f815545cd5e.zip op-kernel-dev-479d014de544a0916037fcf77e873f815545cd5e.tar.gz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to pull in chelsio chcr fix.
Diffstat (limited to 'crypto/algif_hash.c')
-rw-r--r-- | crypto/algif_hash.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 2d8466f..d19b09c 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -214,23 +214,26 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); - if (ctx->more) { + if (!result && !ctx->more) { + err = af_alg_wait_for_completion( + crypto_ahash_init(&ctx->req), + &ctx->completion); + if (err) + goto unlock; + } + + if (!result || ctx->more) { ctx->more = 0; err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req), &ctx->completion); if (err) goto unlock; - } else if (!result) { - err = af_alg_wait_for_completion( - crypto_ahash_digest(&ctx->req), - &ctx->completion); } err = memcpy_to_msg(msg, ctx->result, len); - hash_free_result(sk, ctx); - unlock: + hash_free_result(sk, ctx); release_sock(sk); return err ?: len; |