ptos: mm: Add missing NULL checks
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user