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-next>] [day] [month] [year] [list]
Message-Id: <20240626085416.2831017-1-make24@iscas.ac.cn>
Date: Wed, 26 Jun 2024 16:54:16 +0800
From: Ma Ke <make24@...as.ac.cn>
To: Eugeniy.Paltsev@...opsys.com,
	vkoul@...nel.org,
	andriy.shevchenko@...ux.intel.com,
	jee.heng.sia@...el.com
Cc: dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Ma Ke <make24@...as.ac.cn>
Subject: [PATCH] dmaengine: dw-axi-dmac: Add check for dma_set_max_seg_size in dw_probe()

As the possible failure of the dma_set_max_seg_size(), we should better
check the return value of the dma_set_max_seg_size().

Fixes: 78a90a1e489e ("dmaengine: dw-axi-dmac: Set constraint to the Max segment size")
Signed-off-by: Ma Ke <make24@...as.ac.cn>
---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index fffafa86d964..689667e10928 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1579,7 +1579,10 @@ static int dw_probe(struct platform_device *pdev)
 	 * Therefore, set constraint to 1024 * 4.
 	 */
 	dw->dma.dev->dma_parms = &dw->dma_parms;
-	dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+	ret = dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+	if (ret)
+		return ret;
+
 	platform_set_drvdata(pdev, chip);
 
 	pm_runtime_enable(chip->dev);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ