On 09.02.2026 16:38, Jiri Pirko wrote:
> From: Jiri Pirko <[email protected]>
>
> 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: e53d29f957b3 ("dma-mapping: convert dma_direct_*map_page to be 
> phys_addr_t based")
> Signed-off-by: Jiri Pirko <[email protected]>

I will take this patch when v7.0-rc1 is out, as this fix definitely has 
to be applied regardless of the discussion about the remaining patches.

> ---
>   kernel/dma/direct.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h
> index da2fadf45bcd..62f0d9d0ba02 100644
> --- a/kernel/dma/direct.h
> +++ b/kernel/dma/direct.h
> @@ -88,7 +88,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);
>       }

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Reply via email to