mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 21:47:22 +00:00
dm: hyper_dmabuf: clean up assert
validate fd before use it Tracked-On: #3349 Signed-off-by: Liu Xinyun <xinyun.liu@intel.com> Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
5650183471
commit
bd3f2044eb
@ -15,7 +15,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user