aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c5
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,
258 return -EINVAL; 258 return -EINVAL;
259 obj_priv = obj->driver_private; 259 obj_priv = obj->driver_private;
260 260
261 if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) 261 if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) {
262 drm_gem_object_unreference(obj);
262 return -EINVAL; 263 return -EINVAL;
264 }
263 265
264 mutex_lock(&dev->struct_mutex); 266 mutex_lock(&dev->struct_mutex);
265 267
@@ -289,6 +291,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
289 "failed to unbind object for tiling switch"); 291 "failed to unbind object for tiling switch");
290 args->tiling_mode = obj_priv->tiling_mode; 292 args->tiling_mode = obj_priv->tiling_mode;
291 mutex_unlock(&dev->struct_mutex); 293 mutex_unlock(&dev->struct_mutex);
294 drm_gem_object_unreference(obj);
292 295
293 return ret; 296 return ret;
294 } 297 }