]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()
authorXu Yilun <yilun.xu@linux.intel.com>
Wed, 6 Aug 2025 07:06:05 +0000 (15:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:45 +0000 (16:28 +0200)
commitbb912a20fab0271a7e4d9c063fcd58503d4e0e05
tree51995e37af2c3548c3a619a5f2e2e0d12a132868
parent65e46aeaf84aa88539bcff6b8077e05fbd0700da
fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()

commit 1ca61060de92a4320d73adfe5dc8d335653907ac upstream.

dma_map_sgtable() returns only 0 or the error code. Read sgt->nents to
get the number of mapped segments.

Fixes: 37e00703228a ("zynq_fpga: use sgtable-based scatterlist wrappers")
Reported-by: Pavel Pisa <pisa@fel.cvut.cz>
Closes: https://lore.kernel.org/linux-fpga/202508041548.22955.pisa@fel.cvut.cz/
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Tested-by: Pavel Pisa <pisa@fel.cvut.cz>
Link: https://lore.kernel.org/r/20250806070605.1920909-2-yilun.xu@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/zynq-fpga.c