misc: fix coverity warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee
This commit is contained in:
Dave Barach
2020-05-04 14:47:45 -04:00
committed by Damjan Marion
parent 971c5be279
commit c72950e811
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;