mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
ion: Fail system secure heap creation if system heap is unavailable
The system secure heap relies on the existence of the system heap. Thus, if the system heap is not available, do not create, the system secure heap. Change-Id: I7a99e0fda45ae02ed6e5c8a797d29e917e84f182 Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
parent
2a54c015b8
commit
436d1f81a7
1 changed files with 7 additions and 1 deletions
|
|
@ -323,6 +323,12 @@ static struct ion_heap_ops system_secure_heap_ops = {
|
|||
struct ion_heap *ion_system_secure_heap_create(struct ion_platform_heap *unused)
|
||||
{
|
||||
struct ion_system_secure_heap *heap;
|
||||
struct ion_heap *sys_heap = get_ion_heap(ION_SYSTEM_HEAP_ID);
|
||||
|
||||
if (!sys_heap) {
|
||||
pr_err("Sys heap missing; ensure it's specified in the DT, before the sys secure heap\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
heap = kzalloc(sizeof(*heap), GFP_KERNEL);
|
||||
if (!heap)
|
||||
|
|
@ -330,7 +336,7 @@ struct ion_heap *ion_system_secure_heap_create(struct ion_platform_heap *unused)
|
|||
heap->heap.ion_heap.ops = &system_secure_heap_ops;
|
||||
heap->heap.ion_heap.type =
|
||||
(enum ion_heap_type)ION_HEAP_TYPE_SYSTEM_SECURE;
|
||||
heap->sys_heap = get_ion_heap(ION_SYSTEM_HEAP_ID);
|
||||
heap->sys_heap = sys_heap;
|
||||
|
||||
heap->destroy_heap = false;
|
||||
heap->work_lock = __SPIN_LOCK_UNLOCKED(heap->work_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue