diff mbox

[1/2] gpu: ion: Fix kmalloc leak in carveout heap

Message ID CAD0L9vZ5=Dxd0PMrh1ed4i7qJahfbSE4_CMfA5+z=P98QUSNEQ@mail.gmail.com
State New
Headers show

Commit Message

Nishanth Peethambaran Sept. 4, 2012, 9:40 p.m. UTC
From 78c843052f9438a848dd91334c6392b3b861bfa1 Mon Sep 17 00:00:00 2001
From: Nishanth Peethambaran <nishanth@broadcom.com>
Date: Wed, 5 Sep 2012 02:21:54 +0530
Subject: [PATCH 1/2] gpu: ion: Fix kmalloc leak in carveout heap

In carveout_unmap_dma(), the sg_table is freed.

Change-Id: I8c2372c01a3f4c9061a1756ac9b31e09cf3ab9ef
Signed-off-by: Nishanth Peethambaran <nishanth@broadcom.com>
---
 drivers/gpu/ion/ion_carveout_heap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Nishanth Peethambaran Sept. 4, 2012, 9:44 p.m. UTC | #1
This patch[1/2] is part of Zhangfei's patch for page-wise cache flush.

 - Nishanth Peethambaran


On Wed, Sep 5, 2012 at 3:10 AM, Nishanth Peethambaran
<nishanth.peethu@gmail.com> wrote:
> From 78c843052f9438a848dd91334c6392b3b861bfa1 Mon Sep 17 00:00:00 2001
> From: Nishanth Peethambaran <nishanth@broadcom.com>
> Date: Wed, 5 Sep 2012 02:21:54 +0530
> Subject: [PATCH 1/2] gpu: ion: Fix kmalloc leak in carveout heap
>
> In carveout_unmap_dma(), the sg_table is freed.
>
> Change-Id: I8c2372c01a3f4c9061a1756ac9b31e09cf3ab9ef
> Signed-off-by: Nishanth Peethambaran <nishanth@broadcom.com>
> ---
>  drivers/gpu/ion/ion_carveout_heap.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/ion/ion_carveout_heap.c
> b/drivers/gpu/ion/ion_carveout_heap.c
> index 5b6255b..f7608bc 100644
> --- a/drivers/gpu/ion/ion_carveout_heap.c
> +++ b/drivers/gpu/ion/ion_carveout_heap.c
> @@ -107,6 +107,7 @@ void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
>                                  struct ion_buffer *buffer)
>  {
>         sg_free_table(buffer->sg_table);
> +       kfree(buffer->sg_table);
>  }
>
>  void *ion_carveout_heap_map_kernel(struct ion_heap *heap,
> --
> 1.7.0.4
diff mbox

Patch

diff --git a/drivers/gpu/ion/ion_carveout_heap.c
b/drivers/gpu/ion/ion_carveout_heap.c
index 5b6255b..f7608bc 100644
--- a/drivers/gpu/ion/ion_carveout_heap.c
+++ b/drivers/gpu/ion/ion_carveout_heap.c
@@ -107,6 +107,7 @@  void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
 				 struct ion_buffer *buffer)
 {
 	sg_free_table(buffer->sg_table);
+	kfree(buffer->sg_table);
 }

 void *ion_carveout_heap_map_kernel(struct ion_heap *heap,