Correct NULL access

This commit is contained in:
Mathieu Maret 2021-04-09 20:47:20 +02:00
parent 1d1ed1ef60
commit 32446b3603

View File

@ -125,7 +125,8 @@ static void testPaging(void)
}
printf("%d pages allocated\n", allocCount);
while ((page = list_pop_head(allocated_page_list)) != NULL) {
while (!list_is_empty(allocated_page_list) &&
(page = list_pop_head(allocated_page_list)) != NULL) {
assertmsg((char)page->phy_addr == (char)freeCount, "page modified %d but is %d\n",
freeCount, page->phy_addr);
assertmsg(unrefPhyPage((ulong)page) >= 0, "Failed to free page %d\n", (ulong)page);