From: Julia Lawall Date: Sun, 21 Dec 2008 15:28:47 +0000 (+0100) Subject: drm/i915: Remove redundant test in error path. X-Git-Tag: v2.6.29-rc1~566^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=aad87dff5acb232666932e750318ec1fdb716e79;p=linux-2.6-omap-h63xx.git drm/i915: Remove redundant test in error path. The error path for object list being null is in the second goto target. Signed-off-by: Julia Lawall Signed-off-by: Eric Anholt Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 630eec21b37..cc2ca5561fe 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -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: