drm/i915/overlay: Destroy reg_bo on shutdown.
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 12 Aug 2010 09:50:36 +0000 (10:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Sep 2010 09:23:45 +0000 (10:23 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_overlay.c

index b0aea47cb4452fc0e66d20a6240ff03bf81f8d06..3236cca0bb565a7c85b07351f3ce83f410cce3fe 100644 (file)
@@ -1461,14 +1461,16 @@ void intel_cleanup_overlay(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
 
-       if (dev_priv->overlay) {
-               /* The bo's should be free'd by the generic code already.
-                * Furthermore modesetting teardown happens beforehand so the
-                * hardware should be off already */
-               BUG_ON(dev_priv->overlay->active);
+       if (!dev_priv->overlay)
+               return;
 
-               kfree(dev_priv->overlay);
-       }
+       /* The bo's should be free'd by the generic code already.
+        * Furthermore modesetting teardown happens beforehand so the
+        * hardware should be off already */
+       BUG_ON(dev_priv->overlay->active);
+
+       drm_gem_object_unreference_unlocked(&dev_priv->overlay->reg_bo->base);
+       kfree(dev_priv->overlay);
 }
 
 struct intel_overlay_error_state {