Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swiotlb: avoid potential left shift overflow
The second operand passed to slot_addr() is declared as int or unsigned int in all call sites. The left-shift to get the offset of a slot can overflow if swiotlb size is larger than 4G. Convert the macro to an inline function and declare the second argument as phys_addr_t to avoid the potential overflow. Fixes: 26a7e09 ("swiotlb: refactor swiotlb_tbl_map_single") Signed-off-by: Chao Gao <[email protected]> Reviewed-by: Dongli Zhang <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
- Loading branch information