]> 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:31:08 +0000 (16:31 +0200)
commit598e1e4f392e47fdc57f443f33bb19962f294473
treefd2f957203dcbf757a197369053b5fcfc1ab048d
parentbaa11a683d110cd730fc206d2834decab35fb55c
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