[gem] Hold a reference on the object in i915_gem_wait_space.

Otherwise, in the middle of the function called using it the last ref
might disappear.
main
Eric Anholt 2008-05-21 15:03:47 -07:00
parent f8e38e49dd
commit 7078978db0
1 changed files with 2 additions and 0 deletions

View File

@ -982,7 +982,9 @@ i915_gem_wait_space(struct drm_device *dev)
list);
if (obj_priv == last_priv)
break;
drm_gem_object_reference(obj_priv->obj);
ret = i915_gem_object_wait_rendering(obj_priv->obj);
drm_gem_object_unreference(obj_priv->obj);
if (ret)
break;
last_priv = obj_priv;