From ed53c74ca982a3f221bf7de7c7d18a7d992ac418 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 11 Aug 2021 22:57:02 +0000 Subject: [PATCH] pci: vfio_user: Fix region start calculation in unmap_mmio_regions() The offset on the fd should not be used with the GPA. Signed-off-by: Rob Bradford --- pci/src/vfio_user.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pci/src/vfio_user.rs b/pci/src/vfio_user.rs index b7663cb0e..a4ca1d484 100644 --- a/pci/src/vfio_user.rs +++ b/pci/src/vfio_user.rs @@ -398,18 +398,10 @@ impl VfioUserPciDevice { mmio_region.mmap_size, mmio_region.mem_slot, ) { - let file_offset = self - .client - .lock() - .unwrap() - .region(mmio_region.index) - .unwrap() - .file_offset - .clone(); // Remove region let r = self.vm.make_user_memory_region( mem_slot, - mmio_region.start.raw_value() + file_offset.unwrap().start(), + mmio_region.start.raw_value(), mmap_size as u64, host_addr as u64, false,