From c518a37bef63e5e49582256edb2dcf5b581b75f8 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 4 Aug 2012 13:58:13 +0200 Subject: [PATCH] Fixed compiler warning in PageProtect function family. --- sortix/x86-family/memorymanagement.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sortix/x86-family/memorymanagement.cpp b/sortix/x86-family/memorymanagement.cpp index c6e9d71e..27e02d9d 100644 --- a/sortix/x86-family/memorymanagement.cpp +++ b/sortix/x86-family/memorymanagement.cpp @@ -573,7 +573,8 @@ namespace Sortix void PageProtect(addr_t mapto, int protection) { addr_t phys; - LookUp(mapto, &phys, NULL); + if ( !LookUp(mapto, &phys, NULL) ) + return; Map(phys, mapto, protection); } @@ -581,7 +582,8 @@ namespace Sortix { addr_t phys; int prot; - LookUp(mapto, &phys, &prot); + if ( !LookUp(mapto, &phys, &prot) ) + return; prot |= protection; Map(phys, mapto, prot); } @@ -590,7 +592,8 @@ namespace Sortix { addr_t phys; int prot; - LookUp(mapto, &phys, &prot); + if ( !LookUp(mapto, &phys, &prot) ) + return; prot &= ~protection; Map(phys, mapto, prot); }