diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-01-30 22:10:22 +0100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-02-08 12:38:08 +0100 |
commit | 72daad40dc0be179e0dc85c17d5dc1e850b5e8e4 (patch) | |
tree | 032d006d8c85aeb2dcf75a23f0ed592fed59c4a4 /drivers/gpu | |
parent | drm/i915: add fence register management to execbuf (diff) | |
download | linux-72daad40dc0be179e0dc85c17d5dc1e850b5e8e4.tar.xz linux-72daad40dc0be179e0dc85c17d5dc1e850b5e8e4.zip |
drm/i915: Unref the object after failing to set tiling mode.
Cleanup the object reference on the error paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 2534c792808e..fa1685cba840 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -258,8 +258,10 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, return -EINVAL; obj_priv = obj->driver_private; - if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) + if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) { + drm_gem_object_unreference(obj); return -EINVAL; + } mutex_lock(&dev->struct_mutex); @@ -289,6 +291,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, "failed to unbind object for tiling switch"); args->tiling_mode = obj_priv->tiling_mode; mutex_unlock(&dev->struct_mutex); + drm_gem_object_unreference(obj); return ret; } |