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>] [day] [month] [year] [list]
Message-Id: <20220302100236.170743-1-jiasheng@iscas.ac.cn>
Date:   Wed,  2 Mar 2022 18:02:36 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     vkoul@...nel.org
Cc:     dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] dmaengine: mmp_pdma: Handle error for dma_set_mask

As the potential failure of the dma_set_mask(),
it should be better to check it and return error
if fails.

Fixes: c8acd6aa6bed ("dmaengine: mmp-pdma support")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 drivers/dma/mmp_pdma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 5a53d7fcef01..12085d9fae95 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -1101,9 +1101,11 @@ static int mmp_pdma_probe(struct platform_device *op)
 	pdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
 
 	if (pdev->dev->coherent_dma_mask)
-		dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask);
+		ret = dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask);
 	else
-		dma_set_mask(pdev->dev, DMA_BIT_MASK(64));
+		ret = dma_set_mask(pdev->dev, DMA_BIT_MASK(64));
+	if (ret)
+		return ret;
 
 	ret = dma_async_device_register(&pdev->device);
 	if (ret) {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ