amdgpu: Unlock mutex if base_required is invalid

In the function amdgpu_vamgr_find_va() the function would return
without unlocking the mutex if the base_required offset was below
the va managers base offset.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
main
Tom St Denis 2015-10-09 10:36:04 -04:00 committed by Alex Deucher
parent c745e541a9
commit 988f31ecc2
1 changed files with 3 additions and 1 deletions

View File

@ -124,8 +124,10 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
}
if (base_required) {
if (base_required < mgr->va_offset)
if (base_required < mgr->va_offset) {
pthread_mutex_unlock(&mgr->bo_va_mutex);
return AMDGPU_INVALID_VA_ADDRESS;
}
offset = mgr->va_offset;
waste = base_required - mgr->va_offset;
} else {