[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:
committed by
Travis Geiselbrecht
parent
d4fe1afa7d
commit
d0c4833b3f
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user