gpu: ion: Fix possible memory leak

Change-Id: I66f5ad2c95513dfab9f4fc5ae2fcb1316f486d34
Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
This commit is contained in:
Choi, Jong-Hwan
2011-07-07 09:06:17 +09:00
committed by Rebecca Schultz Zavin
parent 6d3b958d70
commit 5a3e147d52

View File

@@ -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);