[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100306115054.GA3462@viiv.ffwll.ch>
Date: Sat, 6 Mar 2010 12:50:54 +0100
From: Daniel Vetter <daniel@...ll.ch>
To: Dan Carpenter <error27@...il.com>, David Airlie <airlied@...ux.ie>,
Eric Anholt <eric@...olt.net>,
Daniel Vetter <daniel.vetter@...ll.ch>,
maximlevitsky@...il.com, Chris Wilson <chris@...is-wilson.co.uk>,
Luca Barbieri <luca@...a-barbieri.com>,
dri-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [patch] i915: fix small leak on error path
Oh, dang. Thanks for catching this. Eric, please merge.
Cc: stable@...nel.org (for .33)
Reviewed-by: Daniel Vetter <daniel@...ll.ch>
On Sat, Mar 06, 2010 at 02:05:39PM +0300, Dan Carpenter wrote:
> We should free "params" before returning.
>
> Signed-off-by: Dan Carpenter <error27@...il.com>
>
> 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;
--
Daniel Vetter
Mail: daniel@...ll.ch
Mobile: +41 (0)79 365 57 48
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists