x86_64: pmap: add null-pointer to check to delete_pdir
This commit is contained in:
@@ -92,6 +92,7 @@ static void delete_ptab(phys_addr_t pt)
|
|||||||
|
|
||||||
pt &= ~VM_PAGE_MASK;
|
pt &= ~VM_PAGE_MASK;
|
||||||
if (!pt) {
|
if (!pt) {
|
||||||
|
/* physical address of 0x0, nothing to delete */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +108,10 @@ static void delete_pdir(phys_addr_t pd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pd &= ~0x1FFFFFULL;
|
pd &= ~0x1FFFFFULL;
|
||||||
|
if (!pd) {
|
||||||
|
/* physical address of 0x0, nothing to delete */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pdir_t *pdir = vm_phys_to_virt(pd);
|
pdir_t *pdir = vm_phys_to_virt(pd);
|
||||||
for (int i = 0; i < 512; i++) {
|
for (int i = 0; i < 512; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user