Skip to content

Commit

Permalink
drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()
Browse files Browse the repository at this point in the history
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: d099fc8 ("drm/ttm: new TT backend allocation pool v3")
Signed-off-by: Jeremy Cline <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/413432/
Signed-off-by: Christian König <[email protected]>
  • Loading branch information
jeremycline authored and ChristianKoenigAMD committed Jan 11, 2021
1 parent a0adc8e commit 843010a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/ttm/ttm_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 843010a

Please sign in to comment.