From a5e7822628bc339e42f88be160499731864aaaff Mon Sep 17 00:00:00 2001 From: Jianxin Pan Date: Wed, 19 Sep 2018 19:08:29 +0800 Subject: [PATCH] ion: fix null page issue in alloc_buffer_page PD#173802: Panic trace is [] (dma_cache_maint_page) from [] (arm_dma_sync_single_for_device+0x58/0x60) [] (arm_dma_sync_single_for_device) from [] (arm_dma_sync_sg_for_device+0x60/0x8c) [] (arm_dma_sync_sg_for_device) from [] (ion_pages_sync_for_device+0x108/0x144) [] (ion_pages_sync_for_device) from [] (ion_system_heap_allocate+0x38c/0x3bc) [] (ion_system_heap_allocate) from [] (ion_alloc+0x1e4/0x4d8) [] (ion_alloc) from [] (ion_ioctl+0x3b8/0x428) [] (ion_ioctl) from [] (do_vfs_ioctl+0xc0/0xa34) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x7c/0x8c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x48) Change-Id: I7e94ea05334693b6e9bfcc2400c9f7f3ff26736e Signed-off-by: Jianxin Pan --- drivers/staging/android/ion/ion_system_heap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index d270a42..4364072 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -75,7 +75,11 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, page = ion_page_pool_alloc(pool); +#ifdef CONFIG_AMLOGIC_MODIFY + if (cached && page) +#else if (cached) +#endif ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order, DMA_BIDIRECTIONAL); return page; -- 2.7.4