drm: Branch 'master'

[email protected] (Chris Wilson)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 intel/intel_bufmgr_gem.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 19c4cfc54918d361f2535aec16650e9f0be667cd
Author: Chris Wilson <[email protected]>
Date:   Wed Mar 8 21:00:59 2017 +0000

    intel: Add handle to hashtable before freeing along an error path
    
    drm_intel_gem_bo_free() unconditionally attempts to remove the handle
    from the hashtable. This goes horribly wrong if we haven't already added
    the bo to the hashtable.
    
    Reported-by: Michael Thayer <[email protected]>
    Signed-off-by: Chris Wilson <[email protected]>

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index b1e6907..e260f2d 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -815,6 +815,10 @@ retry:
 		}
 
 		bo_gem->gem_handle = create.handle;
+		HASH_ADD(handle_hh, bufmgr_gem->handle_table,
+			 gem_handle, sizeof(bo_gem->gem_handle),
+			 bo_gem);
+
 		bo_gem->bo.handle = bo_gem->gem_handle;
 		bo_gem->bo.bufmgr = bufmgr;
 		bo_gem->bo.align = alignment;
@@ -827,10 +831,6 @@ retry:
 							 tiling_mode,
 							 stride))
 			goto err_free;
-
-		HASH_ADD(handle_hh, bufmgr_gem->handle_table,
-			 gem_handle, sizeof(bo_gem->gem_handle),
-			 bo_gem);
 	}
 
 	bo_gem->name = name;

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.