From patchwork Thu Jan 28 15:24:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 8151531 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4FB0BEEE5 for ; Thu, 28 Jan 2016 15:28:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FC3720364 for ; Thu, 28 Jan 2016 15:28:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3722520304 for ; Thu, 28 Jan 2016 15:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966207AbcA1P2A (ORCPT ); Thu, 28 Jan 2016 10:28:00 -0500 Received: from mga01.intel.com ([192.55.52.88]:61916 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965255AbcA1P17 (ORCPT ); Thu, 28 Jan 2016 10:27:59 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 28 Jan 2016 07:27:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,358,1449561600"; d="scan'208";a="37850284" Received: from ztgrote-mobl1.amr.corp.intel.com (HELO [127.0.1.1]) ([10.254.62.77]) by fmsmga004.fm.intel.com with ESMTP; 28 Jan 2016 07:27:59 -0800 Subject: [PATCH v2 2/2] crypto: algif_skcipher - fix async callback after skcipher convertion From: Tadeusz Struk To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, stable@vger.kernel.org, tadeusz.struk@intel.com Date: Thu, 28 Jan 2016 07:24:05 -0800 Message-ID: <20160128152405.5394.38574.stgit@tstruk-mobl1> In-Reply-To: <20160128152354.5394.90834.stgit@tstruk-mobl1> References: <20160128152354.5394.90834.stgit@tstruk-mobl1> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before the skcipher conversion the async callback used the crypto_async_request directly as the ablkcipher_request. It wasn't quite correct, but it worked fine since the crypto_async_request *base was the first member of the ablkcipher_request struct. After the skcipher conversion it is not the case anymore and a proper cast helper needs to be used. Cc: # 4.4.x- Signed-off-by: Tadeusz Struk --- crypto/algif_skcipher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 38c1aa8..927ed7a 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@ -100,11 +100,12 @@ static void skcipher_free_async_sgls(struct skcipher_async_req *sreq) kfree(sreq->tsg); } -static void skcipher_async_cb(struct crypto_async_request *req, int err) +static void skcipher_async_cb(struct crypto_async_request *req_base, int err) { - struct sock *sk = req->data; + struct sock *sk = req_base->data; struct alg_sock *ask = alg_sk(sk); struct skcipher_ctx *ctx = ask->private; + struct skcipher_request *req = skcipher_request_cast(req_base); struct skcipher_async_req *sreq = GET_SREQ(req, ctx); struct kiocb *iocb = sreq->iocb;