ptos: mm: Add missing NULL checks

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
2026-07-12 06:23:18 +00:00
parent 111e52e054
commit 03c7b160e8
+8 -1
View File
@@ -139,6 +139,10 @@ PmPfdListPop(MM_PFD_LIST *List)
}
FirstPfd = List->First;
if (FirstPfd == NULL) {
return NULL;
}
List->First = FirstPfd->Next;
return FirstPfd;
}
@@ -219,8 +223,11 @@ MmRequestFrame(VOID)
UPTR PhysicalBase;
Pfd = PmPfdListPop(&AvlList);
RtlMemSet(Pfd, 0, PAGESIZE);
if (Pfd == NULL) {
return PFN_ERROR;
}
RtlMemSet(Pfd, 0, PAGESIZE);
PhysicalBase = VMA_TO_PMA(Pfd);
return ADDRESS_TO_PFN(PhysicalBase);
}