vm_phys_early_startup(): Panic if phys_avail[] is empty

Reviewed by:    markj
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48631
This commit is contained in:
Olivier Certner 2024-10-28 17:59:57 +01:00
parent e1499bfff8
commit 32e77bcdec
No known key found for this signature in database
GPG key ID: 8CA13040971E2627

View file

@ -2017,6 +2017,9 @@ vm_phys_early_startup(void)
struct vm_phys_seg *seg;
int i;
if (phys_avail[1] == 0)
panic("phys_avail[] is empty");
for (i = 0; phys_avail[i + 1] != 0; i += 2) {
phys_avail[i] = round_page(phys_avail[i]);
phys_avail[i + 1] = trunc_page(phys_avail[i + 1]);