mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-11 02:20:49 -04:00
The DMA transfer routine was computing the start of the DMA area by taking the address of the coherent allocation, and then adding the transfer's start offset. It then checked manually that the upper bound was valid. Convert this to an I/O projection of the same region, which returns `ERANGE` if the passed range does not fit within the coherent allocation. This removes the need to perform arithmetic on DMA addresses and to explicitly check for the bounds' validity. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260805-falcon-dma-projections-v2-3-4cc9f3f13ee9@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>