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: <20240626082711.2826915-1-make24@iscas.ac.cn>
Date: Wed, 26 Jun 2024 16:27:11 +0800
From: Ma Ke <make24@...as.ac.cn>
To: vkoul@...nel.org,
	make24@...as.ac.cn,
	andriy.shevchenko@...ux.intel.com
Cc: dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] dmaengine: hsu: Add check for dma_set_max_seg_size in hsu_dma_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: 17b3cf4233d7 ("dmaengine: hsu: set maximum allowed segment size for DMA")
Signed-off-by: Ma Ke <make24@...as.ac.cn>
---
 drivers/dma/hsu/hsu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c
index af5a2e252c25..9d02277fa923 100644
--- a/drivers/dma/hsu/hsu.c
+++ b/drivers/dma/hsu/hsu.c
@@ -479,7 +479,9 @@ int hsu_dma_probe(struct hsu_dma_chip *chip)
 
 	hsu->dma.dev = chip->dev;
 
-	dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK);
+	ret = dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK);
+	if (ret)
+		return ret;
 
 	ret = dma_async_device_register(&hsu->dma);
 	if (ret)
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ