Fix coverity issue for potentially overflowing of page size
Change-Id: I2779626d745badb63386efcf729da7a094a4f297
Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
diff --git a/src/vlib/linux/vfio.c b/src/vlib/linux/vfio.c
index 0226271..ffc990a 100644
--- a/src/vlib/linux/vfio.c
+++ b/src/vlib/linux/vfio.c
@@ -52,8 +52,8 @@
vec_foreach_index (i, pr->page_table)
{
int rv;
- dm.vaddr = pointer_to_uword (pr->mem) + (i << pr->log2_page_size);
- dm.size = 1 << pr->log2_page_size;
+ dm.vaddr = pointer_to_uword (pr->mem) + ((u64)i << pr->log2_page_size);
+ dm.size = 1ull << pr->log2_page_size;
dm.iova = dm.vaddr;
vlib_log_debug (lvm->log_default, "map DMA va:0x%lx iova:%lx "
"size:0x%lx", dm.vaddr, dm.iova, dm.size);