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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220304072018.557237-1-jiasheng@iscas.ac.cn>
Date:   Fri,  4 Mar 2022 15:20:18 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     a.zummo@...ertech.it, alexandre.belloni@...tlin.com
Cc:     linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] rtc: snvs: Handle error for clk_enable

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

Fixes: edb190cb1734 ("rtc: snvs: make sure clock is enabled for interrupt handle")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 drivers/rtc/rtc-snvs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index bd929b0e7d7d..f273f7d873f8 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -269,8 +269,11 @@ static irqreturn_t snvs_rtc_irq_handler(int irq, void *dev_id)
 	struct snvs_rtc_data *data = dev_get_drvdata(dev);
 	u32 lpsr;
 	u32 events = 0;
+	int ret;
 
-	clk_enable(data->clk);
+	ret = clk_enable(data->clk);
+	if (ret)
+		return IRQ_NONE;
 
 	regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr);
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ