summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/i386/pagedir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/arch/i386/pagedir.c b/src/kernel/arch/i386/pagedir.c
index 770ff4e..5dd36ec 100644
--- a/src/kernel/arch/i386/pagedir.c
+++ b/src/kernel/arch/i386/pagedir.c
@@ -138,14 +138,14 @@ void *pagedir_virt2phys(struct pagedir *dir, const void __user *virt,
* while i don't currently see a reason to set permissions
* directly on page dirs, i might see one in the future.
* leaving this as-is would be a security bug */
- if (!dir->e[pd_idx].present) return 0;
+ if (!dir->e[pd_idx].present) return NULL;
pagetable = (void*)(dir->e[pd_idx].address << 11);
page = pagetable[pt_idx];
- if (!page.present) return 0;
- if (user && !page.user) return 0;
- if (writeable && !page.writeable) return 0;
+ if (!page.present) return NULL;
+ if (user && !page.user) return NULL;
+ if (writeable && !page.writeable) return NULL;
phys = page.address << 11;
phys |= virt_cast & 0xFFF;