blob: 5363c37e8d5cddd69195ecc60bc348bd0649b97b [file] [log] [blame]
Andrew Geissler84ad7c52020-06-27 00:00:16 -05001Index: mali/linux/mali_memory_os_alloc.c
2===================================================================
3--- mali.orig/linux/mali_memory_os_alloc.c
4+++ mali/linux/mali_memory_os_alloc.c
5@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_
6 /* Ensure page is flushed from CPU caches. */
7 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
8 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
9- dma_unmap_page(&mali_platform_device->dev, dma_addr,
10- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
11+ err = dma_mapping_error(&mali_platform_device->dev, dma_addr);
12+ if (likely(!err))
13+ dma_unmap_page(&mali_platform_device->dev, dma_addr,
14+ _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
15 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
16 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
17