diff options
author | Damjan Marion <damarion@cisco.com> | 2018-10-23 22:54:40 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-23 22:14:04 +0000 |
commit | 8e8d3c8c118a9411b1f8959a0aa545fd7bff5406 (patch) | |
tree | 0a61ceb8fa47af759a47b2165fc83930d275cfef /src/vppinfra | |
parent | 6cfd414e4ce1705ad67923c00b48682a474941cb (diff) |
physmem coverity issues
Change-Id: Ie9ff9b751190632dfc4576e5cbb1987a4142af5e
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r-- | src/vppinfra/pmalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index d354cce8a7d..0f9df9c6641 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -279,7 +279,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a, goto error; } - memset (va, 0, n_pages << pm->log2_page_sz); + clib_memset (va, 0, n_pages << pm->log2_page_sz); sys_page_size = sysconf (_SC_PAGESIZE); pagemap_fd = open ((char *) "/proc/self/pagemap", O_RDONLY); @@ -324,7 +324,8 @@ clib_pmalloc_create_shared_arena (clib_pmalloc_main_t * pm, char *name, { clib_pmalloc_arena_t *a; clib_pmalloc_page_t *pp; - u32 n_pages = round_pow2 (size, 1 << pm->log2_page_sz) >> pm->log2_page_sz; + u32 n_pages = round_pow2 (size, 1ULL << pm->log2_page_sz) >> + pm->log2_page_sz; if (n_pages + vec_len (pm->pages) > pm->max_pages) return 0; |