This patch added checking code to avoid invalid address access for cache
operation.
ion_page_pool_alloc_pages() might return NULL when alloc_pages() could
not get enough pages as requested order, especially in high-order case.
Change-Id: I7aa2bb08f32f523f5b76930b46c0f47d3457895b
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
if (!page) {
page = ion_page_pool_alloc_pages(pool, nozero);
- if (!pool->cached)
+ if (page && !pool->cached)
__flush_dcache_area(page_to_virt(page),
1 << (PAGE_SHIFT + pool->order));
}