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: <20211206021021.1616073-1-jiasheng@iscas.ac.cn>
Date:   Mon,  6 Dec 2021 10:10:21 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     tony@...mide.com, lee.jones@...aro.org
Cc:     linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] mfd: omap-usb-host: Handle dma_set_coherent_mask error codes

The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: cbb8c220e70d ("mfd: Remove omap-usb-host magic numbers for dev dma mask")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 drivers/mfd/omap-usb-host.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 2a3a240b4619..05af9ad314b1 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -169,7 +169,11 @@ static struct platform_device *omap_usbhs_alloc_child(const char *name,
 	}
 
 	child->dev.dma_mask		= &usbhs_dmamask;
-	dma_set_coherent_mask(&child->dev, DMA_BIT_MASK(32));
+	ret = dma_set_coherent_mask(&child->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&child->dev, "DMA enable failed\n");
+		goto err_alloc;
+	}
 	child->dev.parent		= dev;
 
 	ret = platform_device_add(child);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ