lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9735715d9e9fb4e6fbbe19643db1ce80ef51d37a.1538199697.git.baolin.wang@linaro.org>
Date:   Sat, 29 Sep 2018 13:49:01 +0800
From:   Baolin Wang <baolin.wang@...aro.org>
To:     dan.j.williams@...el.com, vkoul@...nel.org,
        eric.long@...eadtrum.com
Cc:     broonie@...nel.org, baolin.wang@...aro.org,
        dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/7] dmaengine: sprd: Fix the last link-list configuration

From: Eric Long <eric.long@...eadtrum.com>

We will pass sglen as 0 configure the last link-list configuration
when filling the descriptor, which will cause the incorrect link-list
configuration. Thus we should check if the sglen is 0 to configure
the correct link-list configuration.

Signed-off-by: Eric Long <eric.long@...eadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
 drivers/dma/sprd-dma.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 4f3587b..e6a74dc 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -697,7 +697,8 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
 		hw->cfg |= SPRD_DMA_LINKLIST_EN;
 
 		/* link-list index */
-		temp = (sg_index + 1) % sglen;
+		temp = sglen ? (sg_index + 1) % sglen : 0;
+
 		/* Next link-list configuration's physical address offset */
 		temp = temp * sizeof(*hw) + SPRD_DMA_CHN_SRC_ADDR;
 		/*
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ