From: Choi, Jong-Hwan Date: Thu, 7 Jul 2011 00:06:17 +0000 (+0900) Subject: gpu: ion: Fix possible memory leak X-Git-Tag: 2.1b_release~2533 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=266ce446d1a71b03ca84a1a50a1cb3e54775219e;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git gpu: ion: Fix possible memory leak Change-Id: I66f5ad2c95513dfab9f4fc5ae2fcb1316f486d34 Signed-off-by: Choi, Jong-Hwan --- diff --git a/drivers/gpu/ion/ion_carveout_heap.c b/drivers/gpu/ion/ion_carveout_heap.c index 245d813..606adae 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);