summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2017-01-13 16:07:00 -0800
committerChris Wilson <chris@chris-wilson.co.uk>2017-01-15 20:15:37 +0000
commit44f220ad6200dbccebea2287b874fda7665efe4d (patch)
treed0e410d7e0e5d7b2b76e02e31cc5b71c86027490
parente1ee01a7583508a47ae45b514f77383abd83db72 (diff)
intel: update global_name before HASH_ADD
bo->global_name should be updated first before a hash value for the entry is calculated with it by HASH_ADD macro. Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--intel/intel_bufmgr_gem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 75949b9f..c47cb9b2 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -2736,11 +2736,12 @@ drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name)
pthread_mutex_lock(&bufmgr_gem->lock);
if (!bo_gem->global_name) {
+ bo_gem->global_name = flink.name;
+ bo_gem->reusable = false;
+
HASH_ADD(name_hh, bufmgr_gem->name_table,
global_name, sizeof(bo_gem->global_name),
bo_gem);
- bo_gem->global_name = flink.name;
- bo_gem->reusable = false;
}
pthread_mutex_unlock(&bufmgr_gem->lock);
}