From: Danylo Vodopianov <dvo-...@napatech.com>

Casting either buf_size and num_descr to uint64_t before performing the
multiplication was done.

Coverity issue: 446740
Fixes: 6b0047fadf41 ("net/ntnic: add queue setup operations")

Signed-off-by: Danylo Vodopianov <dvo-...@napatech.com>
---
 drivers/net/ntnic/ntnic_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 28b086c009..6fcbb8fa9b 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -790,7 +790,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev 
*eth_dev, int vf_num, st
        NT_LOG(DBG, NTNIC, "***** Configure IOMMU for HW queues on VF %i 
*****", vf_num);
 
        /* Just allocate 1MB to hold all combined descr rings */
-       uint64_t tot_alloc_size = 0x100000 + buf_size * num_descr;
+       uint64_t tot_alloc_size = 0x100000 + (uint64_t)buf_size * 
(uint64_t)num_descr;
 
        void *virt =
                rte_malloc_socket("VirtQDescr", tot_alloc_size, 
nt_util_align_size(tot_alloc_size),
-- 
2.45.0

Reply via email to