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:
Sebastien Boeuf 2019-07-20 20:16:51 -07:00
parent 709148803e
commit a761b820c7

View File

@ -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);
}