Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 1 | Index: 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 | |