Commit 6cb09656 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Tomi Valkeinen

drm/omap: omap_gem: Do not try to unmap page which is not mapped

It might be possible that the page has been unmapped already in
omap_gem_cpu_sync() so check before calling dma_unmap_page().
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent a7e8cd39
...@@ -336,7 +336,9 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) ...@@ -336,7 +336,9 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj)
if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) {
int i, npages = obj->size >> PAGE_SHIFT; int i, npages = obj->size >> PAGE_SHIFT;
for (i = 0; i < npages; i++) { for (i = 0; i < npages; i++) {
dma_unmap_page(obj->dev->dev, omap_obj->addrs[i], if (omap_obj->addrs[i])
dma_unmap_page(obj->dev->dev,
omap_obj->addrs[i],
PAGE_SIZE, DMA_BIDIRECTIONAL); PAGE_SIZE, DMA_BIDIRECTIONAL);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment