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.
This commit is contained in:
Ingo Weinhold 2013-11-13 01:45:14 +01:00
parent 5328a58455
commit 93fb0ff056
1 changed files with 2 additions and 2 deletions

View File

@ -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;