Skip to content
/ linux Public

Commit 3e14ba8

Browse files
Jiri PirkoSasha Levin
authored andcommitted
dma-mapping: avoid random addr value print out on error path
[ Upstream commit 47322c4 ] 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 <jiri@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20260209153809.250835-2-jiri@resnulli.us Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ceae058 commit 3e14ba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/dma/direct.h

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

8989
if (is_swiotlb_force_bounce(dev)) {
9090
if (attrs & DMA_ATTR_MMIO)
91-
goto err_overflow;
91+
return DMA_MAPPING_ERROR;
9292

9393
return swiotlb_map(dev, phys, size, dir, attrs);
9494
}

0 commit comments

Comments
 (0)