GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 19c4cfc5 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

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's avatarMichael Thayer <michael.thayer@oracle.com>
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 5ee9cb4b
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment