summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChoi, Jong-Hwan <jhbird.choi@samsung.com>2011-12-13 01:21:22 +0800
committerAndy Green <andy.green@linaro.org>2011-12-26 16:41:49 +0800
commitadd79c1dc9ad67871e5f48082681962c8133c4d1 (patch)
tree3fbce7bb29f17484233c53c84096904ac9f25e7c /drivers
parent547fc84b10d61549e3907e32e295605ef7c7b9c9 (diff)
gpu: ion: Fix possible memory leak
Change-Id: I66f5ad2c95513dfab9f4fc5ae2fcb1316f486d34 Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/ion/ion_carveout_heap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/ion/ion_carveout_heap.c b/drivers/gpu/ion/ion_carveout_heap.c
index 245d81362d5..606adae13f4 100644
--- a/drivers/gpu/ion/ion_carveout_heap.c
+++ b/drivers/gpu/ion/ion_carveout_heap.c
@@ -138,8 +138,10 @@ struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data)
return ERR_PTR(-ENOMEM);
carveout_heap->pool = gen_pool_create(12, -1);
- if (!carveout_heap->pool)
+ if (!carveout_heap->pool) {
+ kfree(carveout_heap);
return ERR_PTR(-ENOMEM);
+ }
carveout_heap->base = heap_data->base;
gen_pool_add(carveout_heap->pool, carveout_heap->base, heap_data->size,
-1);