aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-02-20 12:52:20 -0500
committerDave Airlie <airlied@redhat.com>2009-02-22 19:06:30 -0500
commitbab2d1f6531657e37dc84f26184f3f64e1e73ecd (patch)
treebc55f7e0f38d71dce6714b91d0dab972ab0b81e0
parentf21289b355cee8738d80c2ae5cbd272c3f7b5689 (diff)
drm/i915: Fix regression in 95ca9d
The object is dereferenced before the NULL check. Oops. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20235 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8b50d4820389..25b337438ca7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3143,16 +3143,20 @@ static void
3143i915_gem_cleanup_hws(struct drm_device *dev) 3143i915_gem_cleanup_hws(struct drm_device *dev)
3144{ 3144{
3145 drm_i915_private_t *dev_priv = dev->dev_private; 3145 drm_i915_private_t *dev_priv = dev->dev_private;
3146 struct drm_gem_object *obj = dev_priv->hws_obj; 3146 struct drm_gem_object *obj;
3147 struct drm_i915_gem_object *obj_priv = obj->driver_private; 3147 struct drm_i915_gem_object *obj_priv;
3148 3148
3149 if (dev_priv->hws_obj == NULL) 3149 if (dev_priv->hws_obj == NULL)
3150 return; 3150 return;
3151 3151
3152 obj = dev_priv->hws_obj;
3153 obj_priv = obj->driver_private;
3154
3152 kunmap(obj_priv->page_list[0]); 3155 kunmap(obj_priv->page_list[0]);
3153 i915_gem_object_unpin(obj); 3156 i915_gem_object_unpin(obj);
3154 drm_gem_object_unreference(obj); 3157 drm_gem_object_unreference(obj);
3155 dev_priv->hws_obj = NULL; 3158 dev_priv->hws_obj = NULL;
3159
3156 memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); 3160 memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
3157 dev_priv->hw_status_page = NULL; 3161 dev_priv->hw_status_page = NULL;
3158 3162