Skip to content

Commit

Permalink
crypto: stm32/hash - Fix return issue on update
Browse files Browse the repository at this point in the history
When data append reached the threshold for processing,
we must inform that processing is on going to wait before
managing the next request.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Lionel Debieve authored and Herbert Xu committed Nov 10, 2017
1 parent ced6a58 commit 63c5382
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/crypto/stm32/stm32-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ static int stm32_hash_enqueue(struct ahash_request *req, unsigned int op)
static int stm32_hash_update(struct ahash_request *req)
{
struct stm32_hash_request_ctx *rctx = ahash_request_ctx(req);
int ret;

if (!req->nbytes || !(rctx->flags & HASH_FLAGS_CPU))
return 0;
Expand All @@ -906,12 +905,7 @@ static int stm32_hash_update(struct ahash_request *req)
return 0;
}

ret = stm32_hash_enqueue(req, HASH_OP_UPDATE);

if (rctx->flags & HASH_FLAGS_FINUP)
return ret;

return 0;
return stm32_hash_enqueue(req, HASH_OP_UPDATE);
}

static int stm32_hash_final(struct ahash_request *req)
Expand Down

0 comments on commit 63c5382

Please sign in to comment.