drm/i915: Cleanup trivial leak on execbuffer error path.
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Feb 2009 16:55:20 +0000 (16:55 +0000)
committerDave Airlie <airlied@redhat.com>
Fri, 20 Feb 2009 02:21:09 +0000 (12:21 +1000)
Also spotted by Owain Ainsworth.

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>
drivers/gpu/drm/i915/i915_gem.c

index 818576654092b341746ebb40a846e15ebfb4d5fc..b79ced8f3c61e832f76f451576444ce0e5b89226 100644 (file)
@@ -2480,13 +2480,15 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
        if (dev_priv->mm.wedged) {
                DRM_ERROR("Execbuf while wedged\n");
                mutex_unlock(&dev->struct_mutex);
-               return -EIO;
+               ret = -EIO;
+               goto pre_mutex_err;
        }
 
        if (dev_priv->mm.suspended) {
                DRM_ERROR("Execbuf while VT-switched.\n");
                mutex_unlock(&dev->struct_mutex);
-               return -EBUSY;
+               ret = -EBUSY;
+               goto pre_mutex_err;
        }
 
        /* Look up object handles */