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>
- 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;
}
op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
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;
"offset provided.\n");
op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
return -1;