The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=32e77bcdec5c034a9252876aa018f0bf34b36dbc
commit 32e77bcdec5c034a9252876aa018f0bf34b36dbc Author: Olivier Certner <o...@freebsd.org> AuthorDate: 2024-10-28 16:59:57 +0000 Commit: Olivier Certner <o...@freebsd.org> CommitDate: 2025-02-19 14:13:27 +0000 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 --- sys/vm/vm_phys.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 82272be1a6c9..ca6bec8b8b9f 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -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]);