From patchwork Wed Aug 1 13:23:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daly, Lee" X-Patchwork-Id: 43505 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 663175F36; Wed, 1 Aug 2018 15:23:51 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D0B285F35 for ; Wed, 1 Aug 2018 15:23:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 06:23:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,432,1526367600"; d="scan'208";a="220887692" Received: from silpixa00399501.ir.intel.com ([10.237.223.69]) by orsmga004.jf.intel.com with ESMTP; 01 Aug 2018 06:23:46 -0700 From: Lee Daly To: pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, Lee Daly Date: Wed, 1 Aug 2018 14:23:43 +0100 Message-Id: <1533129823-37697-1-git-send-email-lee.daly@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533035316-63812-1-git-send-email-lee.daly@intel.com> References: <1533035316-63812-1-git-send-email-lee.daly@intel.com> Subject: [dpdk-dev] [PATCH v2] compress/isal: fixes offset check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required. Fixes:788e748d3845 ("compress/isal: support chained mbufs") Signed-off-by: Lee Daly Acked-by: Pablo de Lara --- drivers/compress/isal/isal_compress_pmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c index e75f48d..e943336 100644 --- a/drivers/compress/isal/isal_compress_pmd.c +++ b/drivers/compress/isal/isal_compress_pmd.c @@ -404,9 +404,9 @@ process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp, return -1; } - if (op->dst.offset > op->m_dst->pkt_len) { - ISAL_PMD_LOG(ERR, "Output mbuf(s) not big enough for length" - " and offset provided.\n"); + if (op->dst.offset >= op->m_dst->pkt_len) { + ISAL_PMD_LOG(ERR, "Output mbuf(s) not big enough" + " for offset provided.\n"); op->status = RTE_COMP_OP_STATUS_INVALID_ARGS; return -1; } @@ -483,8 +483,8 @@ process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp) return -1; } - if (op->dst.offset > op->m_dst->data_len) { - ISAL_PMD_LOG(ERR, "Output mbuf not big enough for length and " + if (op->dst.offset >= op->m_dst->pkt_len) { + ISAL_PMD_LOG(ERR, "Output mbuf not big enough for " "offset provided.\n"); op->status = RTE_COMP_OP_STATUS_INVALID_ARGS; return -1;