]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 15:40:21 +0000 (17:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 15:40:21 +0000 (17:40 +0200)
added patches:
fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch

queue-5.10/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch b/queue-5.10/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch
new file mode 100644 (file)
index 0000000..f0821be
--- /dev/null
@@ -0,0 +1,44 @@
+From 1ca61060de92a4320d73adfe5dc8d335653907ac Mon Sep 17 00:00:00 2001
+From: Xu Yilun <yilun.xu@linux.intel.com>
+Date: Wed, 6 Aug 2025 15:06:05 +0800
+Subject: fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()
+
+From: Xu Yilun <yilun.xu@linux.intel.com>
+
+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 |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/fpga/zynq-fpga.c
++++ b/drivers/fpga/zynq-fpga.c
+@@ -405,12 +405,12 @@ static int zynq_fpga_ops_write(struct fp
+               }
+       }
+-      priv->dma_nelms =
+-          dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
+-      if (priv->dma_nelms == 0) {
++      err = dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
++      if (err) {
+               dev_err(&mgr->dev, "Unable to DMA map (TO_DEVICE)\n");
+-              return -ENOMEM;
++              return err;
+       }
++      priv->dma_nelms = sgt->nents;
+       /* enable clock */
+       err = clk_enable(priv->clk);
index d7396de2b9d8c876d912bcd1b2cf1428b0bf6934..1e8819a499ec88e4dd02db535dd2f4ea0a163993 100644 (file)
@@ -401,3 +401,4 @@ selftests-mptcp-connect-also-cover-alt-modes.patch
 fs-buffer-fix-use-after-free-when-call-bh_read-helpe.patch
 move_mount-allow-to-add-a-mount-into-an-existing-gro.patch
 use-uniform-permission-checks-for-all-mount-propagat.patch
+fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch