summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorHaiyang Tan <haiyangtan@tencent.com>2018-10-15 06:17:55 -0700
committerDamjan Marion <dmarion@me.com>2018-10-16 11:37:49 +0000
commita5ab5034f4b50fc5a19ccf8910c91613e6a52f5a (patch)
tree7ada95f1671e1f5b525355a6f90e6456813a012c /src/vppinfra
parente9239c978277d838c0c5ca0ad3076ef85d15138a (diff)
Fix coverity issue for potentially overflowing of page size
Change-Id: I2779626d745badb63386efcf729da7a094a4f297 Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/linux/mem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index 2d968fae0ac..227e55b6d56 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -73,7 +73,8 @@ clib_mem_vm_randomize_va (uword * requested_va, u32 log2_page_size)
else
bit_mask = 0;
- *requested_va += (clib_cpu_time_now () & bit_mask) * (1 << log2_page_size);
+ *requested_va +=
+ (clib_cpu_time_now () & bit_mask) * (1ull << log2_page_size);
}
clib_error_t *
@@ -257,7 +258,7 @@ clib_mem_vm_ext_free (clib_mem_vm_alloc_t * a)
{
if (a != 0)
{
- clib_mem_vm_free (a->addr, 1 << a->log2_page_size);
+ clib_mem_vm_free (a->addr, 1ull << a->log2_page_size);
if (a->fd != -1)
close (a->fd);
}