From 762be1b25b9807d23b55a281c02c1791deb3b117 Mon Sep 17 00:00:00 2001 From: Jasvinder Singh Date: Thu, 19 Oct 2017 10:39:45 +0100 Subject: [PATCH] net/softnic: fix integer overflow Fixed integer overflow by casting hard_rate to uint64_t type. Coverity issue: 195020 Fixes: 8316b9816b79 ("net/softnic: support traffic management") Signed-off-by: Jasvinder Singh Reviewed-by: Ferruh Yigit --- drivers/net/softnic/rte_eth_softnic_tm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/softnic/rte_eth_softnic_tm.c b/drivers/net/softnic/rte_eth_softnic_tm.c index 682cc4dec0..dbb251432d 100644 --- a/drivers/net/softnic/rte_eth_softnic_tm.c +++ b/drivers/net/softnic/rte_eth_softnic_tm.c @@ -47,7 +47,7 @@ int tm_params_check(struct pmd_params *params, uint32_t hard_rate) { - uint64_t hard_rate_bytes_per_sec = hard_rate * BYTES_IN_MBPS; + uint64_t hard_rate_bytes_per_sec = (uint64_t)hard_rate * BYTES_IN_MBPS; uint32_t i; /* rate */ -- 2.20.1