summaryrefslogtreecommitdiff
path: root/intel/intel_bufmgr_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-13 10:30:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-13 10:41:33 +0000
commitc5f0ed1d296f11367febd0e1b7dce8789308bf35 (patch)
tree62bc772f394c0f28250799d28ade670cd6d3443c /intel/intel_bufmgr_gem.c
parentdd9a5b4f7fb07c78db4e7481bedca1b981030e3f (diff)
intel: Update map-count for an early error return during mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'intel/intel_bufmgr_gem.c')
-rw-r--r--intel/intel_bufmgr_gem.c2
1 files changed, 2 insertions, 0 deletions
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;
}