From c72950e811880c22e5b350c4b1cb5e31b0735b4d Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 4 May 2020 14:47:45 -0400 Subject: misc: fix coverity warnings Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee --- src/vlib/linux/pci.c | 2 +- src/vnet/lisp-cp/one_api.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c index 8af1cdab0d4..722fb888117 100644 --- a/src/vlib/linux/pci.c +++ b/src/vlib/linux/pci.c @@ -1137,7 +1137,7 @@ vlib_pci_map_region_int (vlib_main_t * vm, vlib_pci_dev_handle_t h, if (*result == (void *) -1) { error = clib_error_return_unix (0, "mmap `BAR%u'", bar); - if (p->type == LINUX_PCI_DEVICE_TYPE_UIO) + if (p->type == LINUX_PCI_DEVICE_TYPE_UIO && (fd != -1)) close (fd); return error; } diff --git a/src/vnet/lisp-cp/one_api.c b/src/vnet/lisp-cp/one_api.c index 912b9dffd0e..f7a972be7a2 100644 --- a/src/vnet/lisp-cp/one_api.c +++ b/src/vnet/lisp-cp/one_api.c @@ -1119,7 +1119,7 @@ one_adjacency_copy (vl_api_one_adjacency_t * dst, lisp_adjacency_t * adjs) a.leid.address.nsh.si = gid_address_nsh_si (&adj->leid); break; default: - ASSERT (0); + ALWAYS_ASSERT (0); } a.reid.type = eid_type; a.leid.type = eid_type; -- cgit 1.2.3-korg