[PATCH] intel: update global_name before HASH_ADD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 intel/intel_bufmgr_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 75949b9..c47cb9b 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);
 	}
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux