summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c')
-rw-r--r--UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
index 52535e5a8d..218068a3e1 100644
--- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
+++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
@@ -544,7 +544,7 @@ PageTableLibMapInLevel (
@retval RETURN_BUFFER_TOO_SMALL The buffer is too small for page table creation/updating.
BufferSize is updated to indicate the expected buffer size.
Caller may still get RETURN_BUFFER_TOO_SMALL with the new BufferSize.
- @retval RETURN_SUCCESS PageTable is created/updated successfully.
+ @retval RETURN_SUCCESS PageTable is created/updated successfully or the input Length is 0.
**/
RETURN_STATUS
EFIAPI
@@ -567,6 +567,10 @@ PageTableMap (
IA32_PAGE_LEVEL MaxLeafLevel;
IA32_MAP_ATTRIBUTE ParentAttribute;
+ if (Length == 0) {
+ return RETURN_SUCCESS;
+ }
+
if ((PagingMode == Paging32bit) || (PagingMode == PagingPae) || (PagingMode >= PagingModeMax)) {
//
// 32bit paging is never supported.