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: d099fc8f54 ("drm/ttm: new TT backend allocation pool v3")
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/413432/
Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Jeremy Cline 2021-01-11 11:40:33 -05:00 committed by Christian König
parent a0adc8eabb
commit 843010a815
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}