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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-08-11 22:57:02 +00:00
parent 0b5c680d15
commit ed53c74ca9

View File

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