Skip to content

Commit

Permalink
crypto: ahash - Fully restore ahash request before completing
Browse files Browse the repository at this point in the history
When finishing the ahash request, the ahash_op_unaligned_done() will
call complete() on the request. Yet, this will not call the correct
complete callback. The correct complete callback was previously stored
in the requests' private data, as seen in ahash_op_unaligned(). This
patch restores the correct complete callback and .data field of the
request before calling complete() on it.

Signed-off-by: Marek Vasut <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Shawn Guo <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Marek Vasut authored and herbertx committed Jan 5, 2014
1 parent 8610d7b commit 1d9a394
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crypto/ahash.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)

ahash_op_unaligned_finish(areq, err);

complete(data, err);
areq->base.complete = complete;
areq->base.data = data;

complete(&areq->base, err);
}

static int ahash_op_unaligned(struct ahash_request *req,
Expand Down

0 comments on commit 1d9a394

Please sign in to comment.