lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50F5C6CF.50800@ti.com>
Date:	Tue, 15 Jan 2013 15:14:55 -0600
From:	Rob Clark <rob@...com>
To:	Cong Ding <dinggnu@...il.com>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Seung-Woo Kim <sw0312.kim@...sung.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	YAMANE Toshiaki <yamanetoshi@...il.com>,
	<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: omapdrm/omap_gem_dmabuf.c: fix memory leakage

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@...il.com>

Signed-off-by: Rob Clark <rob@...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,

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ