From: Marek Vasut Subject: [PATCH 1/5] crypto: Fully restore ahash request before completing Date: Sun, 1 Dec 2013 22:20:19 +0100 Message-ID: <1385932823-3860-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Herbert Xu , "David S. Miller" , Fabio Estevam , Shawn Guo , linux-crypto@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Return-path: Received: from mail-out.m-online.net ([212.18.0.10]:54146 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457Ab3LAVWj (ORCPT ); Sun, 1 Dec 2013 16:22:39 -0500 Sender: linux-crypto-owner@vger.kernel.org List-ID: 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: Herbert Xu Cc: David S. Miller Cc: Fabio Estevam Cc: Shawn Guo Cc: linux-crypto@vger.kernel.org --- crypto/ahash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 793a27f..a92dc38 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -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, -- 1.8.4.2