Skip to content

Commit 47322c4

Browse files
Jiri Pirkomszyprow
authored andcommitted
dma-mapping: avoid random addr value print out on error path
dma_addr is unitialized in dma_direct_map_phys() when swiotlb is forced and DMA_ATTR_MMIO is set which leads to random value print out in warning. Fix that by just returning DMA_MAPPING_ERROR. Fixes: e53d29f ("dma-mapping: convert dma_direct_*map_page to be phys_addr_t based") Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6de23f8 commit 47322c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/dma/direct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev,
8585

8686
if (is_swiotlb_force_bounce(dev)) {
8787
if (attrs & DMA_ATTR_MMIO)
88-
goto err_overflow;
88+
return DMA_MAPPING_ERROR;
8989

9090
return swiotlb_map(dev, phys, size, dir, attrs);
9191
}

0 commit comments

Comments
 (0)