x86_64: pmap: add null-pointer to check to delete_pdir

This commit is contained in:
2023-02-07 12:10:05 +00:00
parent 3ea1a28e5a
commit 52c1ba89c4

View File

@@ -92,6 +92,7 @@ static void delete_ptab(phys_addr_t pt)
pt &= ~VM_PAGE_MASK;
if (!pt) {
/* physical address of 0x0, nothing to delete */
return;
}
@@ -107,6 +108,10 @@ static void delete_pdir(phys_addr_t pd)
}
pd &= ~0x1FFFFFULL;
if (!pd) {
/* physical address of 0x0, nothing to delete */
return;
}
pdir_t *pdir = vm_phys_to_virt(pd);
for (int i = 0; i < 512; i++) {