diff --git a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c index 18c563075..f7a8a2e0c 100644 --- a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c +++ b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "dm.h" @@ -343,8 +342,9 @@ virtio_hyper_dmabuf_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) virtio_hyper_dmabuf_k_stop(); virtio_hyper_dmabuf_k_reset(); kstatus = VIRTIO_DEV_INITIAL; - assert(vbs_k_hyper_dmabuf_fd >= 0); - close(vbs_k_hyper_dmabuf_fd); + if (vbs_k_hyper_dmabuf_fd >= 0) { + close(vbs_k_hyper_dmabuf_fd); + } vbs_k_hyper_dmabuf_fd = -1; }