From 8e8d3c8c118a9411b1f8959a0aa545fd7bff5406 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 23 Oct 2018 22:54:40 +0200 Subject: physmem coverity issues Change-Id: Ie9ff9b751190632dfc4576e5cbb1987a4142af5e Signed-off-by: Damjan Marion --- src/vlib/buffer.c | 2 +- src/vlib/physmem.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vlib') diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index 2f15e6530da..22cf7999be7 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -860,7 +860,7 @@ vlib_buffer_register_physmem_map (vlib_main_t * vm, u32 physmem_map_index) vlib_buffer_pool_t *p; vlib_physmem_map_t *m = vlib_physmem_get_map (vm, physmem_map_index); uword start = pointer_to_uword (m->base); - uword size = m->n_pages << m->log2_page_size; + uword size = (uword) m->n_pages << m->log2_page_size; if (bm->buffer_mem_size == 0) { diff --git a/src/vlib/physmem.c b/src/vlib/physmem.c index e2d88922f56..2599bce944d 100755 --- a/src/vlib/physmem.c +++ b/src/vlib/physmem.c @@ -39,7 +39,7 @@ vlib_physmem_shared_map_create (vlib_main_t * vm, char *name, uword size, clib_pmalloc_arena_t *a; clib_error_t *error = 0; void *va; - int i; + uword i; va = clib_pmalloc_create_shared_arena (pm, name, size, numa_node); @@ -87,7 +87,7 @@ vlib_physmem_init (vlib_main_t * vm) /* check if pagemap is accessible */ pt = clib_mem_vm_get_paddr (&pt, min_log2 (sysconf (_SC_PAGESIZE)), 1); - if (pt[0]) + if (pt && pt[0]) vpm->flags |= VLIB_PHYSMEM_MAIN_F_HAVE_PAGEMAP; vec_free (pt); -- cgit 1.2.3-korg