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: <aIGVJ7UV1wzkQ2Bt@pc>
Date: Thu, 24 Jul 2025 03:06:31 +0100
From: Salah Triki <salah.triki@...il.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>,
	linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: salah.triki@...il.com
Subject: [PATCH] rtc: twl: Check return value of platform_get_irq()

platform_get_irq() may fail, so check its return value and propagate
the error in case of failure.

Signed-off-by: Salah Triki <salah.triki@...il.com>
---
 drivers/rtc/rtc-twl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index e6106e67e1f4..992b3e1347f2 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -224,8 +224,11 @@ static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
-	int irq = platform_get_irq(pdev, 0);
-	int ret;
+	int irq, ret;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	if (enabled) {
 		ret = set_rtc_irq_bit(twl_rtc,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ