All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <rob@ti.com>
To: Cong Ding <dinggnu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	YAMANE Toshiaki <yamanetoshi@gmail.com>,
	<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: omapdrm/omap_gem_dmabuf.c: fix memory leakage
Date: Tue, 15 Jan 2013 15:14:55 -0600	[thread overview]
Message-ID: <50F5C6CF.50800@ti.com> (raw)
In-Reply-To: <1358279214-4820-1-git-send-email-dinggnu@gmail.com>

On 01/15/2013 01:46 PM, Cong Ding wrote:
> There is a memory leakage in variable sg if it goes to error.
>
> Signed-off-by: Cong Ding <dinggnu@gmail.com>

Signed-off-by: Rob Clark <rob@ti.com>

> ---
>   drivers/staging/omapdrm/omap_gem_dmabuf.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c
> index b6c5b5c..a3236ab 100644
> --- a/drivers/staging/omapdrm/omap_gem_dmabuf.c
> +++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c
> @@ -53,10 +53,10 @@ static struct sg_table *omap_gem_map_dma_buf(
>   	/* this should be after _get_paddr() to ensure we have pages attached */
>   	omap_gem_dma_sync(obj, dir);
>   
> -out:
> -	if (ret)
> -		return ERR_PTR(ret);
>   	return sg;
> +out:
> +	kfree(sg);
> +	return ERR_PTR(ret);
>   }
>   
>   static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,


      reply	other threads:[~2013-01-15 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 19:46 [PATCH] staging: omapdrm/omap_gem_dmabuf.c: fix memory leakage Cong Ding
2013-01-15 21:14 ` Rob Clark [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F5C6CF.50800@ti.com \
    --to=rob@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=dinggnu@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=yamanetoshi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.