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: <20241206222452.3479786-1-zmw12306@gmail.com>
Date: Fri,  6 Dec 2024 17:24:52 -0500
From: Mingwei Zheng <zmw12306@...il.com>
To: alexandre.belloni@...tlin.com,
	gxt@...c.pku.edu.cn,
	linus.walleij@...aro.org,
	haojian.zhuang@...il.com,
	broonie@...nsource.wolfsonmicro.com,
	akpm@...ux-foundation.org
Cc: linux-rtc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Mingwei Zheng <zmw12306@...il.com>,
	Jiasheng Jiang <jiashengjiangcool@...il.com>
Subject: [PATCH] rtc: Add check for clk_enable()

Add check for the return value of clk_enable() to catch the potential
error.

Fixes: 0c4eae66591a ("rtc: convert drivers/rtc/* to use module_platform_driver()")
Signed-off-by: Mingwei Zheng <zmw12306@...il.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
---
 drivers/rtc/rtc-spear.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 26eed927f8b3..064d46b2f16e 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -437,7 +437,7 @@ static int spear_rtc_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct spear_rtc_config *config = platform_get_drvdata(pdev);
-	int irq;
+	int irq, ret;
 
 	irq = platform_get_irq(pdev, 0);
 
@@ -447,7 +447,9 @@ static int spear_rtc_resume(struct device *dev)
 			config->irq_wake = 0;
 		}
 	} else {
-		clk_enable(config->clk);
+		ret = clk_enable(config->clk);
+		if (ret)
+			return ret;
 		spear_rtc_enable_interrupt(config);
 	}
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ