diff --git a/arch/x86_64/pmap.c b/arch/x86_64/pmap.c index 2fff1b2..4af4390 100644 --- a/arch/x86_64/pmap.c +++ b/arch/x86_64/pmap.c @@ -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++) {