Commit 843010a8 authored by Jeremy Cline's avatar Jeremy Cline Committed by Christian König

drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()

check_unmap() is producing a warning about a missing map error check.
The return value from dma_map_page() should be checked for an error, not
the caller-provided dma_addr.

Fixes: d099fc8f ("drm/ttm: new TT backend allocation pool v3")
Signed-off-by: default avatarJeremy Cline <jcline@redhat.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/413432/Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
parent a0adc8ea
......@@ -190,7 +190,7 @@ static int ttm_pool_map(struct ttm_pool *pool, unsigned int order,
size_t size = (1ULL << order) * PAGE_SIZE;
addr = dma_map_page(pool->dev, p, 0, size, DMA_BIDIRECTIONAL);
if (dma_mapping_error(pool->dev, **dma_addr))
if (dma_mapping_error(pool->dev, addr))
return -EFAULT;
}
......
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