dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create().
@ 2013-09-04  6:28 Manjunath Goudar
  2013-09-06 13:23 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Manjunath Goudar @ 2013-09-04  6:28 UTC (permalink / raw)
  To: patches
  Cc: linaro-kernel, dsaxena, Jeyaraman R, Manjunath Goudar,
	David Airlie, Paul E. McKenney, David Howells, Thomas Gleixner,
	Dave Jones, Dave Airlie, dri-devel, linux-kernel

From: Jeyaraman R <jeyaraman.rangasamy@lge.com> 

This patch adds kfree() in ttm_agp_tt_create() to avoide the
memory leak, without this there is a chance of memory leak in
ttm_tt_init() fail case.

Signed-off-by: Jeyaraman R <jeyaraman.rangasamy@lge.com>
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/gpu/drm/ttm/ttm_agp_backend.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index 3302f99..764be36 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -126,6 +126,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
 	agp_be->ttm.func = &ttm_agp_func;
 
 	if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) {
+		kfree(agp_be);
 		return NULL;
 	}
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create().
  2013-09-04  6:28 [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create() Manjunath Goudar
@ 2013-09-06 13:23 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-09-06 13:23 UTC (permalink / raw)
  To: Manjunath Goudar
  Cc: patches, linaro-kernel, Jeyaraman R, linux-kernel, dri-devel,
	David Howells, dsaxena, Dave Airlie, Dave Jones, Thomas Gleixner,
	Paul E. McKenney

On Wed, Sep 04, 2013 at 11:58:10AM +0530, Manjunath Goudar wrote:
> From: Jeyaraman R <jeyaraman.rangasamy@lge.com> 
> 
> This patch adds kfree() in ttm_agp_tt_create() to avoide the
> memory leak, without this there is a chance of memory leak in
> ttm_tt_init() fail case.
> 
> Signed-off-by: Jeyaraman R <jeyaraman.rangasamy@lge.com>
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Cc: David Airlie <airlied@linux.ie>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Dave Jones <davej@redhat.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> ---
>  drivers/gpu/drm/ttm/ttm_agp_backend.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> index 3302f99..764be36 100644
> --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
> +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> @@ -126,6 +126,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
>  	agp_be->ttm.func = &ttm_agp_func;
>  
>  	if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) {
> +		kfree(agp_be);
>  		return NULL;
>  	}
>  
> -- 
> 1.8.1.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create().
@ 2013-10-08 10:36 Majunath Goudar
  0 siblings, 0 replies; 3+ messages in thread
From: Majunath Goudar @ 2013-10-08 10:36 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: nataraja.km, Majunath Goudar, Jeyaraman R, David Airlie,
	Paul E. McKenney, David Howells, Thomas Gleixner, Dave Jones,
	Dave Airlie, dri-devel, linux-kernel

This patch adds kfree() in ttm_agp_tt_create() to avoide the
memory leak, without this there is a chance of memory leak in
ttm_tt_init() fail case.

Signed-off-by: Jeyaraman R <jeyaraman.rangasamy@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/gpu/drm/ttm/ttm_agp_backend.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index 3302f99..764be36 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -126,6 +126,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
 	agp_be->ttm.func = &ttm_agp_func;
 
 	if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) {
+		kfree(agp_be);
 		return NULL;
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-08 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04  6:28 [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create() Manjunath Goudar
2013-09-06 13:23 ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2013-10-08 10:36 Majunath Goudar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).