summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-06 11:05:39 (GMT)
committerEric Anholt <eric@anholt.net>2010-03-17 20:30:15 (GMT)
commit915a428e43acfd05e4ffeaf40549b0cf163eebe2 (patch)
tree717b701bbc378aa06ace37c11c45716be8794dc1
parent1f2b10131f83f7caa67bf1273cec126b4283015d (diff)
downloadlinux-fsl-qoriq-915a428e43acfd05e4ffeaf40549b0cf163eebe2.tar.xz
drm/i915: fix small leak on overlay error path
We should free "params" before returning. Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Cc: stable@kernel.org (for .33) Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index d355d1d..60595fc 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1068,14 +1068,18 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id,
DRM_MODE_OBJECT_CRTC);
- if (!drmmode_obj)
- return -ENOENT;
+ if (!drmmode_obj) {
+ ret = -ENOENT;
+ goto out_free;
+ }
crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
new_bo = drm_gem_object_lookup(dev, file_priv,
put_image_rec->bo_handle);
- if (!new_bo)
- return -ENOENT;
+ if (!new_bo) {
+ ret = -ENOENT;
+ goto out_free;
+ }
mutex_lock(&dev->mode_config.mutex);
mutex_lock(&dev->struct_mutex);
@@ -1165,6 +1169,7 @@ out_unlock:
mutex_unlock(&dev->struct_mutex);
mutex_unlock(&dev->mode_config.mutex);
drm_gem_object_unreference_unlocked(new_bo);
+out_free:
kfree(params);
return ret;