summaryrefslogtreecommitdiff
path: root/drivers/compress/isal/isal_compress_pmd.c
diff options
context:
space:
mode:
authorLee Daly <lee.daly@intel.com>2018-08-01 14:23:43 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2018-08-03 09:14:24 +0200
commit7f474b4324e8280b3c4df3ee3c93d79b0f5417b0 (patch)
tree8d004e3762b043698b92869ba1dee624de94aaf9 /drivers/compress/isal/isal_compress_pmd.c
parent219ae4a12995e5a8ee5e184655a37dd4ee96bf25 (diff)
downloaddpdk-7f474b4324e8280b3c4df3ee3c93d79b0f5417b0.zip
dpdk-7f474b4324e8280b3c4df3ee3c93d79b0f5417b0.tar.gz
dpdk-7f474b4324e8280b3c4df3ee3c93d79b0f5417b0.tar.xz
compress/isal: fix offset check
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, to support single and multi-segment buffers. Fixes: 788e748d3845 ("compress/isal: support chained mbufs") Signed-off-by: Lee Daly <lee.daly@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Diffstat (limited to 'drivers/compress/isal/isal_compress_pmd.c')
-rw-r--r--drivers/compress/isal/isal_compress_pmd.c10
1 files 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;