summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonk.liu <monk.liu@amd.com>2015-04-23 13:19:57 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-05-07 13:08:50 -0400
commit65d820e921a35a1770c30e4b62e043ed0730950a (patch)
tree40bd230256015c48ba4f004578507b9b09f51b4d
parent1fcd08bc9cda75fc04e35736d3c908cdc5135954 (diff)
downloaddrm-65d820e921a35a1770c30e4b62e043ed0730950a.tar.gz
amdgpu: add missing mutex lock/unlock pair
Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--amdgpu/amdgpu_bo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index cbc4cd6c..b4ca7f72 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -626,8 +626,10 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
amdgpu_bo_free_internal(bo);
return r;
}
+ pthread_mutex_lock(&dev->bo_table_mutex);
util_hash_table_set(dev->bo_vas,
(void*)(uintptr_t)bo->virtual_mc_base_address, bo);
+ pthread_mutex_unlock(&dev->bo_table_mutex);
info->buf_handle = bo;
info->virtual_mc_base_address = bo->virtual_mc_base_address;
info->virtual_mc_base_address += off;