[v2,6/9] baseband/acc: fix potential arithmetic overflow
Checks
Commit Message
Fix potential issue of overflow causing coverity warning.
Coverity issue: 383154
Fixes: 8e16839937 ("baseband/acc: extension of the device structure")
Cc: stable@dpdk.org
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/baseband/acc/rte_vrb_pmd.c | 2 +-
drivers/baseband/acc/vrb_pmd.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
@@ -518,7 +518,7 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)
if (d->tail_ptrs == NULL)
d->tail_ptrs = rte_zmalloc_socket(
dev->device->driver->name,
- d->num_qgroups * d->num_aqs * sizeof(uint32_t),
+ VRB_MAX_QGRPS * VRB_MAX_AQS * sizeof(uint32_t),
RTE_CACHE_LINE_SIZE, socket_id);
if (d->tail_ptrs == NULL) {
rte_bbdev_log(ERR, "Failed to allocate tail ptr for %s:%u",
@@ -36,6 +36,7 @@
#define VRB_NUM_ACCS 6
#define VRB_MAX_QGRPS 32
+#define VRB_MAX_AQS 32
#define ACC_STATUS_WAIT 10
#define ACC_STATUS_TO 100