From c5f0ed1d296f11367febd0e1b7dce8789308bf35 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 13 Dec 2011 10:30:54 +0000 Subject: intel: Update map-count for an early error return during mapping Signed-off-by: Chris Wilson --- intel/intel_bufmgr_gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 55ff5ab2..bb096de5 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1180,6 +1180,8 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) __FILE__, __LINE__, bo_gem->gem_handle, bo_gem->name, strerror(errno)); + if (--bo_gem->map_count == 0) + drm_intel_gem_bo_close_vma(bufmgr_gem, bo_gem); pthread_mutex_unlock(&bufmgr_gem->lock); return ret; } -- cgit v1.2.3