From: Marek Vasut Date: Tue, 10 Dec 2013 19:26:19 +0000 (+0100) Subject: crypto: ahash - Fully restore ahash request before completing X-Git-Tag: v3.2.89~18 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=cf55237533d7e62bdfb5b8235806493e32f9ee47 crypto: ahash - Fully restore ahash request before completing commit 1d9a394b97b833d3ab37f49caf12d0be3c88050b upstream. 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 Cc: David S. Miller Cc: Fabio Estevam Cc: Shawn Guo Signed-off-by: Herbert Xu Signed-off-by: Ben Hutchings --- diff --git a/crypto/ahash.c b/crypto/ahash.c index 8271185d4ad9..ed8666b3d3ef 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -214,7 +214,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,