summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-09 15:02:50 -0700
committerEric Anholt <eric@anholt.net>2008-05-09 15:02:50 -0700
commitf0ae335cd70077043f2f7af39d7edcc529367c61 (patch)
tree861c81ae7207738eb71d05c48b0eb529d00307a7
parentec75369b402235d74b06b08907572050962075a6 (diff)
GEM: Avoid leaking refs on target objects on presumed offset success.
-rw-r--r--linux-core/i915_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index ff8e2762..be30d6bf 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -640,8 +640,10 @@ i915_gem_reloc_and_validate_object(struct drm_gem_object *obj,
/* If the relocation already has the right value in it, no
* more work needs to be done.
*/
- if (target_obj_priv->gtt_offset == reloc.presumed_offset)
+ if (target_obj_priv->gtt_offset == reloc.presumed_offset) {
+ drm_gem_object_unreference(target_obj);
continue;
+ }
/* Now that we're going to actually write some data in,
* make sure that any rendering using this buffer's contents