diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-02-27 09:19:50 -0500 |
---|---|---|
committer | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-02-28 06:30:23 -0500 |
commit | 05e0ab1b38cee3dacbfff7b4cc06e4b74290f2f4 (patch) | |
tree | c29b2c7635f13696661546f027758a9dbd1888ce /lib/dma.c | |
parent | 4a35a27cecb4d61e891967c751bda799a7492a9b (diff) | |
download | libvfio-user-05e0ab1b38cee3dacbfff7b4cc06e4b74290f2f4.zip libvfio-user-05e0ab1b38cee3dacbfff7b4cc06e4b74290f2f4.tar.gz libvfio-user-05e0ab1b38cee3dacbfff7b4cc06e4b74290f2f4.tar.bz2 |
don't dup DMA region fd
fixes #47
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r-- | lib/dma.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -207,13 +207,7 @@ dma_controller_add_region(lm_ctx_t *lm_ctx, dma_controller_t *dma, region->size = size; region->page_size = page_size; region->offset = offset; - - region->fd = dup(fd); // dup the fd to get our own private copy - if (region->fd < 0) { - lm_log(lm_ctx, LM_ERR, "failed to duplicate file descriptor: %s\n", - strerror(errno)); - goto err; - } + region->fd = fd; region->virt_addr = dma_map_region(region, PROT_READ | PROT_WRITE, 0, region->size); |