From patchwork Wed Sep 28 15:58:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 117067 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F299A00C4; Wed, 28 Sep 2022 19:07:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 384044113C; Wed, 28 Sep 2022 19:07:20 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 631F3410FA for ; Wed, 28 Sep 2022 19:07:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664384838; x=1695920838; h=from:to:cc:subject:date:message-id; bh=cjAqaZ9Jtrv+W0QMV6TDGhDynVg1L4lGe+aXZ6wtGuo=; b=oH1RsLG9zIrQd8azSCzmiSXV7n/1KwWmtPe9QH5j4j3noHk5cJXVyg5X yCjk5UgJtLmGznwEVIn1FEvjIP5R+/QB/Ncszw6wFYFESeEVWw+3kljUN RiGQPdzYjE6fhim3azSxnxdEPS4LsUWZCg7/xGtUmUZSsOQJlemOkPX79 JUmpEvuHgxm3FIOBCsDJlBzVQD/Z1SmvZEaInanVipyVrAmYWsJo+FG4g qWDlmiNg2u04bi8mswadu6OMZVh9ZDKbIQRKkxDUr/RNH7eip6zr5TFKa xikYdMRw94p/ST43w/HiJLCg6wSjTNAeOdwl/stO6f/KBk/3z7Vko3DjE g==; X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="281376319" X-IronPort-AV: E=Sophos;i="5.93,352,1654585200"; d="scan'208";a="281376319" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2022 10:07:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="690470404" X-IronPort-AV: E=Sophos;i="5.93,352,1654585200"; d="scan'208";a="690470404" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga004.fm.intel.com with ESMTP; 28 Sep 2022 10:07:15 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, kai.ji@intel.com, Arek Kusztal Subject: [PATCH 1/2] crypto/qat: fix uncleared cookies in asym Date: Wed, 28 Sep 2022 16:58:10 +0100 Message-Id: <20220928155811.25016-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fixed incorrectly placed clean function in asym response. Fixes: 002486db239e ("crypto/qat: refactor asymmetric session") Signed-off-by: Arek Kusztal --- drivers/crypto/qat/qat_asym.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c index 19931791c4..4b0538eea8 100644 --- a/drivers/crypto/qat/qat_asym.c +++ b/drivers/crypto/qat/qat_asym.c @@ -906,6 +906,8 @@ qat_asym_process_response(void **out_op, uint8_t *resp, " returned error"); } } + if (op->status == RTE_CRYPTO_OP_STATUS_ERROR) + goto finalize; switch (op->sess_type) { case RTE_CRYPTO_OP_WITH_SESSION: @@ -923,9 +925,10 @@ qat_asym_process_response(void **out_op, uint8_t *resp, if (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED) { op->status = qat_asym_collect_response(op, cookie, xform); - cleanup(cookie, xform, cookie->alg_bytesize); } +finalize: + cleanup(cookie, xform, cookie->alg_bytesize); *out_op = op; HEXDUMP("resp_msg:", resp_msg, sizeof(struct icp_qat_fw_pke_resp));