raw/ifpga: fix integer overflow for N3000
authorWei Huang <wei.huang@intel.com>
Thu, 23 Jun 2022 03:11:40 +0000 (23:11 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 26 Jun 2022 10:20:25 +0000 (12:20 +0200)
commit099da89792e611ddcd177f5ff06d6ab6bd82dd0f
treef2b39646ffb5b6d8de6399f7fa94ce25ff8742da
parent26f5a0d5a6bb3d839d0361aac4ff46b6358bd2a7
raw/ifpga: fix integer overflow for N3000

Expression "tx_chunks * ctx->dma_buf_size" in dma_fpga_to_fpga()
is evaluated using 32-bit arithmetic, which would overflow
 potentially. Change tx_chunks to type "uint64_t" to avoid such
issue.

Coverity issue: 379203
Fixes: 7d63899a5c19 ("raw/ifpga: add N3000 AFU driver")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
drivers/raw/ifpga/afu_pmd_n3000.c