[kernel][vm] Fix end address checks

If the end of a range is at the end of the virtual address space,
(base + size) is 0. Use (base + size - 1) instead.

Change-Id: I7d02250d765df0ab2bd23b60ee7a484951238c58
This commit is contained in:
Arve Hjønnevåg
2015-02-17 16:22:31 -08:00
committed by Travis Geiselbrecht
parent d4fe1afa7d
commit d0c4833b3f
2 changed files with 3 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ void *paddr_to_kvaddr(paddr_t pa)
while (map->size > 0) {
if (!(map->flags & MMU_INITIAL_MAPPING_TEMPORARY) &&
pa >= map->phys &&
pa <= map->phys + map->size) {
pa <= map->phys + map->size - 1) {
return (void *)(map->virt + (pa - map->phys));
}
map++;