diff options
author | Chris Wright <chrisw@sous-sol.org> | 2009-04-17 01:18:55 +0000 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-21 18:25:18 -0700 |
commit | 355d7f370b51bbb6f31aaf9f98861057e1e6bbb2 (patch) | |
tree | 999c1c660c62aa6501bda57d54da684c2713292a /drivers | |
parent | d816f6ac4f9877509baa3610be0d25b7afc29c00 (diff) | |
download | blackbird-op-linux-355d7f370b51bbb6f31aaf9f98861057e1e6bbb2.tar.gz blackbird-op-linux-355d7f370b51bbb6f31aaf9f98861057e1e6bbb2.zip |
drm/i915: fix up error path leak in i915_cmdbuffer
Commit 201361a5 introduces a leak when unwinding on error. Reorder
unwind, and eliminate leak.
Cc: Eric Anholt <eric@anholt.net>
Cc: Keith Packard <keithp@keithp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
[anholt: fixed uninit variable use introduced in original patch]
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 272614389c02..051134c56aef 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -713,18 +713,18 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, mutex_unlock(&dev->struct_mutex); if (ret) { DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); - goto fail_batch_free; + goto fail_clip_free; } if (sarea_priv) sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); -fail_batch_free: - drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); fail_clip_free: drm_free(cliprects, cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), DRM_MEM_DRIVER); +fail_batch_free: + drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); return ret; } |