Skip to content
Commit cdcda0d1 authored by Kishon Vijay Abraham I's avatar Kishon Vijay Abraham I Committed by Christoph Hellwig
Browse files

dma-direct: fix data truncation in dma_direct_get_required_mask()



The upper 32-bit physical address gets truncated inadvertently
when dma_direct_get_required_mask() invokes phys_to_dma_direct().
This results in dma_addressing_limited() return incorrect value
when used in platforms with LPAE enabled.
Fix it here by explicitly type casting 'max_pfn' to phys_addr_t
in order to prevent overflow of intermediate value while evaluating
'(max_pfn - 1) << PAGE_SHIFT'.

Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent f5e94d10
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment