From 705cfb09dc5876b073f71c21818f1b0b376e2daf Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Wed, 7 Feb 2018 16:38:09 +0900 Subject: [PATCH] android: ion: give name to carveout_heap Heap name is required by ion_query_heaps() because we cannot identify a specific heap without name. Change-Id: I39d886255c8381d11f067ec6f19a105e7269010c Signed-off-by: Cho KyongHo --- drivers/staging/android/ion/ion_carveout_heap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index 52718cdec6ad..cdbdba66aa48 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -149,6 +149,13 @@ struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data) -1); carveout_heap->heap.ops = &carveout_heap_ops; carveout_heap->heap.type = ION_HEAP_TYPE_CARVEOUT; + carveout_heap->heap.name = kstrndup(heap_data->name, + MAX_HEAP_NAME - 1, GFP_KERNEL); + if (!carveout_heap->heap.name) { + kfree(carveout_heap); + gen_pool_destroy(carveout_heap->pool); + return ERR_PTR(-ENOMEM); + } return &carveout_heap->heap; } -- 2.20.1