[08/11] net/bnxt: address coverity overflow issues
Checks
Commit Message
From: Peter Spreadborough <peter.spreadborough@broadcom.com>
This change addresses the CID 449058: Integer handling issues
(OVERFLOW_BEFORE_WIDEN) reported by coverity.
Coverity issue: 449058
Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -468,7 +468,7 @@ static int alloc_link_pbl(struct tfc_ts_mem_cfg *mem_cfg, uint32_t page_size,
* and page tables. The allocation will occur once only per backing
* store and will located by name and reused on subsequent runs.
*/
- total_size = page_size * total_pages;
+ total_size = (uint64_t)page_size * (uint64_t)total_pages;
if (total_size <= (1024 * 256))
mz_size = RTE_MEMZONE_256KB;