diff options
Diffstat (limited to 'drivers/gpu/ion')
-rw-r--r-- | drivers/gpu/ion/ion_carveout_heap.c | 4 |
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 245d81362d5d..606adae13f48 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); |