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]
Date:   Wed,  6 Dec 2017 20:42:37 +0100
From:   Andreas Platschek <andreas.platschek@...ntech.at>
To:     linux-kernel@...r.kernel.org
Cc:     a.zummo@...ertech.it, alexandre.belloni@...e-electrons.com,
        linux-rtc@...r.kernel.org,
        Andreas Platschek <andreas.platschek@...ntech.at>
Subject: [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error

clk_prepare_enable() returns an error -> check it.

Signed-off-by: Andreas Platschek <andreas.platschek@...ntech.at>
---
 drivers/rtc/rtc-omap.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 1d666ac9ef70..ad309feb7d11 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -748,8 +748,15 @@ static int omap_rtc_probe(struct platform_device *pdev)
 	else
 		rtc->clk = devm_clk_get(&pdev->dev, "int-clk");
 
-	if (!IS_ERR(rtc->clk))
-		clk_prepare_enable(rtc->clk);
+	if (!IS_ERR(rtc->clk)) {
+		ret = clk_prepare_enable(rtc->clk);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable rtc clk (%u)\n", ret);
+			return ret;
+		}
+	}
+
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	rtc->base = devm_ioremap_resource(&pdev->dev, res);
-- 
2.11.0

Powered by blists - more mailing lists