drm/i915: Remove redundant test in error path.
authorJulia Lawall <julia@diku.dk>
Sun, 21 Dec 2008 15:28:47 +0000 (16:28 +0100)
committerDave Airlie <airlied@linux.ie>
Mon, 29 Dec 2008 07:47:27 +0000 (17:47 +1000)
The error path for object list being null is in the second goto target.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/gpu/drm/i915/i915_gem.c

index 630eec21b3732c0ffd359249316d818a2fa6889e..cc2ca5561feb5add0ebac9bd6d3a7d58e4008c4c 100644 (file)
@@ -2613,13 +2613,12 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
                          "back to user (%d)\n",
                           args->buffer_count, ret);
 err:
-       if (object_list != NULL) {
-               for (i = 0; i < pinned; i++)
-                       i915_gem_object_unpin(object_list[i]);
+       for (i = 0; i < pinned; i++)
+               i915_gem_object_unpin(object_list[i]);
+
+       for (i = 0; i < args->buffer_count; i++)
+               drm_gem_object_unreference(object_list[i]);
 
-               for (i = 0; i < args->buffer_count; i++)
-                       drm_gem_object_unreference(object_list[i]);
-       }
        mutex_unlock(&dev->struct_mutex);
 
 pre_mutex_err: