diff options
author | Damjan Marion <damarion@cisco.com> | 2018-10-26 10:29:35 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-28 14:58:45 +0000 |
commit | 878b65aa6c16b6013e75ea9039b9978c52982e97 (patch) | |
tree | 3b0d1412d6e83996741f39cf50bee6699fbbdcff /src | |
parent | 5665cedf57165c05d00f28de06b627047902ffce (diff) |
physmem: coverity issues
Change-Id: I34cc55d8292a69fb451ed0031484994f51d3537a
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/ixge/ixge.c | 3 | ||||
-rw-r--r-- | src/vppinfra/pmalloc.c | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/ixge/ixge.c b/src/plugins/ixge/ixge.c index 5dc22bed3a5..a3c0c978ab3 100644 --- a/src/plugins/ixge/ixge.c +++ b/src/plugins/ixge/ixge.c @@ -2843,9 +2843,6 @@ ixge_pci_init (vlib_main_t * vm, vlib_pci_dev_handle_t h) vlib_pci_addr_t *addr = vlib_pci_get_addr (vm, h); vlib_pci_device_info_t *d = vlib_pci_get_device_info (vm, addr, 0); - if (error) - return error; - error = vlib_pci_map_region (vm, h, 0, &r); if (error) return error; diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index 98e3369bbca..a881a65310a 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -101,7 +101,7 @@ clib_pmalloc_init (clib_pmalloc_main_t * pm, uword size) pm->base += off; } - munmap (pm->base + (pm->max_pages * pagesize), pagesize - off); + munmap (pm->base + ((uword) pm->max_pages * pagesize), pagesize - off); return 0; } @@ -215,7 +215,7 @@ pmalloc_update_lookup_table (clib_pmalloc_main_t * pm, u32 first, u32 count) p = first * elts_per_page; if (pm->flags & CLIB_PMALLOC_F_NO_PAGEMAP) { - while (p < elts_per_page * count) + while (p < (uword) elts_per_page * count) { pm->lookup_table[p] = pointer_to_uword (pm->base) + (p << pm->lookup_log2_page_sz); @@ -225,9 +225,10 @@ pmalloc_update_lookup_table (clib_pmalloc_main_t * pm, u32 first, u32 count) } fd = open ((char *) "/proc/self/pagemap", O_RDONLY); - while (p < elts_per_page * count) + while (p < (uword) elts_per_page * count) { va = pointer_to_uword (pm->base) + (p << pm->lookup_log2_page_sz); + pa = 0; seek = (va >> pm->sys_log2_page_sz) * sizeof (pa); if (fd != -1 && lseek (fd, seek, SEEK_SET) == seek && read (fd, &pa, sizeof (pa)) == (sizeof (pa)) && |