aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom St Denis2015-10-09 09:36:04 -0500
committerAlex Deucher2015-10-22 11:35:14 -0500
commit988f31ecc29770a2648bf5c7d7779f1e500c196c (patch)
tree6f54cf185dbe8ccf1386e5a1269863bf342dd0b1
parentc745e541a9d8dfd3fb5e1ac57297e58d34d9328f (diff)
downloadexternal-libgbm-988f31ecc29770a2648bf5c7d7779f1e500c196c.tar.gz
external-libgbm-988f31ecc29770a2648bf5c7d7779f1e500c196c.tar.xz
external-libgbm-988f31ecc29770a2648bf5c7d7779f1e500c196c.zip
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>
-rw-r--r--amdgpu/amdgpu_vamgr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 04d28817..2221da03 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -124,8 +124,10 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
124 } 124 }
125 125
126 if (base_required) { 126 if (base_required) {
127 if (base_required < mgr->va_offset) 127 if (base_required < mgr->va_offset) {
128 pthread_mutex_unlock(&mgr->bo_va_mutex);
128 return AMDGPU_INVALID_VA_ADDRESS; 129 return AMDGPU_INVALID_VA_ADDRESS;
130 }
129 offset = mgr->va_offset; 131 offset = mgr->va_offset;
130 waste = base_required - mgr->va_offset; 132 waste = base_required - mgr->va_offset;
131 } else { 133 } else {