mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
After free(old_base), if allocate(new_base) fails the allocator treats old_base as free even though the MMIO/PIO bus still maps the device there. Subsequent allocations pick old_base, mmio_bus.insert hits the live mapping and returns Overlap. Restore old_base on the failure path in both the Memory*BitRegion and IoRegion branches before bubbling the error up. PR #7950 added restore_bar_addr() so the BAR config register stays consistent on failed move_bar(); this completes the same picture for the allocator side. Signed-off-by: CMGS <ilskdw@gmail.com>