Fix out of bounds access.
Coverity issue: 354230, 354231
Fixes:
f44e71637755 ("net/octeontx2: add security session operations")
Fixes:
3fe4d07d1678 ("crypto/octeontx2: enable CPT to share QP with ethdev")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
struct otx2_sec_idev_cfg *cfg;
int i, ret;
- if (qp == NULL || port_id > OTX2_MAX_INLINE_PORTS)
+ if (qp == NULL || port_id >= OTX2_MAX_INLINE_PORTS)
return -EINVAL;
cfg = &sec_cfg[port_id];
uint16_t index;
int i, ret;
- if (port_id > OTX2_MAX_INLINE_PORTS || qp == NULL)
+ if (port_id >= OTX2_MAX_INLINE_PORTS || qp == NULL)
return -EINVAL;
cfg = &sec_cfg[port_id];