From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7D7B6558C for ; Tue, 29 Mar 2016 19:19:27 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 29 Mar 2016 10:19:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,412,1455004800"; d="scan'208";a="75342989" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 29 Mar 2016 10:19:23 -0700 Received: from linux.site (sisvmlab045.ir.intel.com [10.237.216.57]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u2THJMwa015204; Tue, 29 Mar 2016 18:19:22 +0100 Received: by linux.site (Postfix, from userid 11342333) id 7E15DE3BC2; Tue, 29 Mar 2016 18:10:41 +0100 (IST) From: Fiona Trahe To: dev@dpdk.org Cc: Declan.doherty@intel.com, Fiona Trahe Date: Tue, 29 Mar 2016 18:10:20 +0100 Message-Id: <1459271420-10830-1-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] qat: Fix for crash when nb_ops=0 on enqueue_burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 17:19:27 -0000 Crash seen in qat pmd when nb_ops=0 on rte_cryptodev_enqueue_burst() API Signed-off-by: Fiona Trahe --- drivers/crypto/qat/qat_crypto.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 5c41a89..90b5e6c 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -570,6 +570,9 @@ qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops, register uint32_t tail; int overflow; + if (unlikely(nb_ops == 0)) + return 0; + /* read params used a lot in main loop into registers */ queue = &(tmp_qp->tx_q); base_addr = (uint8_t *)queue->base_addr; -- 1.7.0.7