From patchwork Wed Jan 27 17:14:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 8135991 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B3D49F818 for ; Wed, 27 Jan 2016 17:17:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C4D020328 for ; Wed, 27 Jan 2016 17:17:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B97320364 for ; Wed, 27 Jan 2016 17:17:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932985AbcA0RRz (ORCPT ); Wed, 27 Jan 2016 12:17:55 -0500 Received: from mga02.intel.com ([134.134.136.20]:48901 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932833AbcA0RRy (ORCPT ); Wed, 27 Jan 2016 12:17:54 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 27 Jan 2016 09:17:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,355,1449561600"; d="scan'208";a="642294577" Received: from tstruk-mobl1.jf.intel.com (HELO [127.0.1.1]) ([134.134.171.59]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jan 2016 09:17:53 -0800 Subject: [PATCH 2/3] 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: Wed, 27 Jan 2016 09:14:01 -0800 Message-ID: <20160127171401.32579.42285.stgit@tstruk-mobl1> In-Reply-To: <20160127171350.32579.49931.stgit@tstruk-mobl1> References: <20160127171350.32579.49931.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..78529ce 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, int err) { - struct sock *sk = req->data; + struct sock *sk = _req->data; struct alg_sock *ask = alg_sk(sk); struct skcipher_ctx *ctx = ask->private; + struct skcipher_request *req = skcipher_request_cast(_req); struct skcipher_async_req *sreq = GET_SREQ(req, ctx); struct kiocb *iocb = sreq->iocb;