From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbdFAPnj (ORCPT ); Thu, 1 Jun 2017 11:43:39 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:32920 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbdFAPnh (ORCPT ); Thu, 1 Jun 2017 11:43:37 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Herbert Xu" , "Fabio Estevam" , "Marek Vasut" , "Shawn Guo" , "David S. Miller" Date: Thu, 01 Jun 2017 16:40:55 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 084/101] crypto: ahash - Fully restore ahash request before completing In-Reply-To: X-SA-Exim-Connect-IP: 82.70.136.246 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.89-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Marek Vasut 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 --- crypto/ahash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -214,7 +214,10 @@ static void ahash_op_unaligned_done(stru 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,