From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5B9722C2F; Mon, 3 Apr 2017 18:35:53 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 03 Apr 2017 09:35:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,271,1486454400"; d="scan'208";a="243513772" Received: from silpixa00381633.ir.intel.com (HELO silpixa00381633.ger.corp.intel.com) ([10.237.222.114]) by fmsmga004.fm.intel.com with ESMTP; 03 Apr 2017 09:35:51 -0700 From: Fan Zhang To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, stable@dpdk.org Date: Mon, 3 Apr 2017 17:37:29 +0100 Message-Id: <1491237449-113572-1-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491234435-112340-1-git-send-email-roy.fan.zhang@intel.com> References: <1491234435-112340-1-git-send-email-roy.fan.zhang@intel.com> Subject: [dpdk-stable] [PATCH v2] crypto/scheduler: fix session free X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 16:35:54 -0000 This patch fixes the incorrection slave session free operation. Fixes: 57523e682bb7 ("crypto/scheduler: register operation functions") Signed-off-by: Fan Zhang --- v2: - Remove unnecessary session set line. drivers/crypto/scheduler/scheduler_pmd_ops.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c index f02506c..cd8c6a8 100644 --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c @@ -433,9 +433,10 @@ config_slave_sess(struct scheduler_ctx *sched_ctx, if (create) continue; /* !create */ - (*dev->dev_ops->session_clear)(dev, - (void *)sess->sessions[i]); - sess->sessions[i] = NULL; + sess->sessions[i] = rte_cryptodev_sym_session_free( + slave->dev_id, sess->sessions[i]); + if (!sess->sessions[i]) + return -1; } else { if (!create) continue; @@ -443,10 +444,6 @@ config_slave_sess(struct scheduler_ctx *sched_ctx, sess->sessions[i] = rte_cryptodev_sym_session_create( slave->dev_id, xform); - if (!sess->sessions[i]) { - config_slave_sess(sched_ctx, NULL, sess, 0); - return -1; - } } } -- 2.7.4