vm_phys: Fix vm_phys_find_range() after commit 69cbb18746

vm_phys_seg_paddr_to_vm_page() expects a PA that's in bounds, but
vm_phys_find_range() purposefully returns a pointer to the end of the
last page in a segment.

Fixes:	69cbb18746 ("vm_phys: Add a vm_phys_seg_paddr_to_vm_page() helper")
This commit is contained in:
Mark Johnston 2024-06-14 00:09:45 -04:00
parent aede0d3bad
commit fbff6d54da

View file

@ -1450,7 +1450,7 @@ vm_phys_find_range(vm_page_t bounds[], int segind, int domain,
vm_phys_lazy_init_domain(domain, false);
#endif
bounds[0] = vm_phys_seg_paddr_to_vm_page(seg, pa_start);
bounds[1] = vm_phys_seg_paddr_to_vm_page(seg, pa_end);
bounds[1] = &seg->first_page[atop(pa_end - seg->start)];
return (seg - vm_phys_segs);
}
return (-1);