From 93fb0ff0565694c4cfd752e5550680bf86aeb37e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 13 Nov 2013 01:45:14 +0100 Subject: [PATCH] vm: lock_memory_etc(): Fix error case In case something went wrong, call unlock_memory_etc() with the rounded base address instead of with the original address. If the original address wasn't page aligned, unlock_memory_etc() would otherwise try to unlock an additional page. --- src/system/kernel/vm/vm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 7afa856d9d..0fec8a24bd 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -5459,8 +5459,8 @@ lock_memory_etc(team_id team, void* address, size_t numBytes, uint32 flags) // even if not a single page was wired, unlock_memory_etc() is called // to put the address space reference. addressSpaceLocker.Unlock(); - unlock_memory_etc(team, (void*)address, nextAddress - lockBaseAddress, - flags); + unlock_memory_etc(team, (void*)lockBaseAddress, + nextAddress - lockBaseAddress, flags); } return error;