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;
|
FirstPfd = List->First;
|
||||||
|
if (FirstPfd == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
List->First = FirstPfd->Next;
|
List->First = FirstPfd->Next;
|
||||||
return FirstPfd;
|
return FirstPfd;
|
||||||
}
|
}
|
||||||
@@ -219,8 +223,11 @@ MmRequestFrame(VOID)
|
|||||||
UPTR PhysicalBase;
|
UPTR PhysicalBase;
|
||||||
|
|
||||||
Pfd = PmPfdListPop(&AvlList);
|
Pfd = PmPfdListPop(&AvlList);
|
||||||
RtlMemSet(Pfd, 0, PAGESIZE);
|
if (Pfd == NULL) {
|
||||||
|
return PFN_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlMemSet(Pfd, 0, PAGESIZE);
|
||||||
PhysicalBase = VMA_TO_PMA(Pfd);
|
PhysicalBase = VMA_TO_PMA(Pfd);
|
||||||
return ADDRESS_TO_PFN(PhysicalBase);
|
return ADDRESS_TO_PFN(PhysicalBase);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user