mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 00:56:20 +01:00
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: e53d29f957 ("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
This commit is contained in:
parent
6de23f81a5
commit
47322c469d
1 changed files with 1 additions and 1 deletions
|
|
@ -85,7 +85,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev,
|
|||
|
||||
if (is_swiotlb_force_bounce(dev)) {
|
||||
if (attrs & DMA_ATTR_MMIO)
|
||||
goto err_overflow;
|
||||
return DMA_MAPPING_ERROR;
|
||||
|
||||
return swiotlb_map(dev, phys, size, dir, attrs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue