diff options
author | Chris Wright <chrisw@sous-sol.org> | 2009-04-16 21:18:55 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-21 21:25:18 -0400 |
commit | 355d7f370b51bbb6f31aaf9f98861057e1e6bbb2 (patch) | |
tree | 999c1c660c62aa6501bda57d54da684c2713292a /drivers | |
parent | d816f6ac4f9877509baa3610be0d25b7afc29c00 (diff) |
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, | |||
713 | mutex_unlock(&dev->struct_mutex); | 713 | mutex_unlock(&dev->struct_mutex); |
714 | if (ret) { | 714 | if (ret) { |
715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); | 715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); |
716 | goto fail_batch_free; | 716 | goto fail_clip_free; |
717 | } | 717 | } |
718 | 718 | ||
719 | if (sarea_priv) | 719 | if (sarea_priv) |
720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); | 720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); |
721 | 721 | ||
722 | fail_batch_free: | ||
723 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
724 | fail_clip_free: | 722 | fail_clip_free: |
725 | drm_free(cliprects, | 723 | drm_free(cliprects, |
726 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), | 724 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), |
727 | DRM_MEM_DRIVER); | 725 | DRM_MEM_DRIVER); |
726 | fail_batch_free: | ||
727 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
728 | 728 | ||
729 | return ret; | 729 | return ret; |
730 | } | 730 | } |