]> www.infradead.org Git - users/jedix/linux-maple.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>
Tue, 19 Aug 2025 10:54:45 +0000 (12:54 +0200)
commit1ca61060de92a4320d73adfe5dc8d335653907ac
tree73e0ae942d4a53237b90cfbe39b87055310b07ee
parentc17b750b3ad9f45f2b6f7e6f7f4679844244f0b9
fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()

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