drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/ttm/ttm_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_pool.c +1 -1
@@ -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 ; }
Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 11.01.21 um 17:40 schrieb Jeremy Cline:
Quoted 6 lines
check_unmap()is producing a warning about a missing map error check. The return value fromdma_map_page()should be checked for an error, not the caller-provideddma_addr.Fixes d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")Signed-off-by Jeremy Cline <[email protected]>
Good catch. Reviewed and pushed to drm-misc-fixes, should be in the -rc by the weekend.
Thanks for the help,
Christian.
Quoted 9 lines
--- drivers/gpu/drm/ttm/ttm_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_pool.c +0
-0
drivers/gpu/drm/ttm/ttm_pool.c static int ttm_pool_map(struct ttm_pool *pool, unsigned int order, · line 196
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_pool.c +1
-1@@ -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 ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Christian König
Am 11.01.21 um 17:40 schrieb Jeremy Cline:
Quoted 6 lines
check_unmap()is producing a warning about a missing map error check. The return value fromdma_map_page()should be checked for an error, not the caller-provideddma_addr.Fixes d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")Signed-off-by Jeremy Cline <[email protected]>Good catch. Reviewed and pushed to drm-misc-fixes, should be in the -rc by the weekend.
Great, many thanks!
- Jeremy
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel