mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-07 04:07:21 +00:00
vm-allocator: Fix the aligned address check
The requested address for a range can be the base of the entire address space, this is a valid use case. In particular, when creating an MMIO address space of 0-64GiB, we might want to create a range of 0-1GiB if the RAM of our VM is 1G. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
709148803e
commit
a761b820c7
@ -90,7 +90,7 @@ impl AddressAllocator {
|
||||
}
|
||||
|
||||
// The aligned address should be within the address space range.
|
||||
if aligned_address >= self.end || aligned_address <= self.base {
|
||||
if aligned_address >= self.end || aligned_address < self.base {
|
||||
return Err(Error::Overflow);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user