mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
a7e8cd39af
commit
6cb096562e
1 changed files with 4 additions and 2 deletions
|
@ -336,8 +336,10 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj)
|
|||
if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) {
|
||||
int i, npages = obj->size >> PAGE_SHIFT;
|
||||
for (i = 0; i < npages; i++) {
|
||||
dma_unmap_page(obj->dev->dev, omap_obj->addrs[i],
|
||||
PAGE_SIZE, DMA_BIDIRECTIONAL);
|
||||
if (omap_obj->addrs[i])
|
||||
dma_unmap_page(obj->dev->dev,
|
||||
omap_obj->addrs[i],
|
||||
PAGE_SIZE, DMA_BIDIRECTIONAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue