[PATCH 1/3] amdgpu: Unlock mutex if base_required is invalid
Alex Deucher
alexdeucher at gmail.com
Thu Oct 22 09:40:21 PDT 2015
From: Tom St Denis <tom.stdenis at amd.com>
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 at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
---
amdgpu/amdgpu_vamgr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 04d2881..2221da0 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,
}
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 {
--
1.8.3.1
More information about the dri-devel
mailing list