net/softnic: fix integer overflow
PATCH 1/1 net/softnic: fix integer overflow
Fixed integer overflow by casting hard_rate to uint64_t type.
CID 195020 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
Fixes 8316b9816b79 ("net/softnic: support traffic management")
Signed-off-by Jasvinder Singh <[email protected]>
--- drivers/net/softnic/rte_eth_softnic_tm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/softnic/rte_eth_softnic_tm.c +1 -1
@@ -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 */
Signature · 1 line
2.9.3
Quoted 1 line · Jasvinder Singh
Fixed integer overflow by casting
hard_ratetouint64_ttype.
Coverity Issue: 195020
Quoted 3 lines
Fixes 8316b9816b79 ("net/softnic: support traffic management")Signed-off-by Jasvinder Singh <[email protected]>
Reviewed-by Ferruh Yigit <[email protected]>
Ferruh Yigit
AppliedQuoted 9 lines · Ferruh Yigit
Quoted 1 line · Jasvinder Singh
Fixed integer overflow by casting
hard_ratetouint64_ttype.Coverity Issue: 195020
Quoted 3 lines
Fixes 8316b9816b79 ("net/softnic: support traffic management")Signed-off-by Jasvinder Singh <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied to dpdk-next-net/master, thanks.