* [PATCH] rtc: fix error return in pm80x_rtc_read_alarm()
@ 2025-10-02 9:18 Alexandr Sapozhnkiov
0 siblings, 0 replies; 3+ messages in thread
From: Alexandr Sapozhnkiov @ 2025-10-02 9:18 UTC (permalink / raw)
To: Alexandre Belloni, linux-rtc, linux-kernel
Cc: Alexandr Sapozhnikov, lvc-project
From: Alexandr Sapozhnikov <alsp705@gmail.com>
The regmap_raw_read() function may return an error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
---
drivers/rtc/rtc-88pm80x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index f40cc06b0979..44d324c3101c 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -148,7 +148,9 @@ static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
unsigned long ticks, base, data;
int ret;
- regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4);
+ ret = regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4);
+ if (ret)
+ return ret;
base = ((unsigned long)buf[3] << 24) | (buf[2] << 16) |
(buf[1] << 8) | buf[0];
dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] rtc: fix error return in pm80x_rtc_read_alarm()
@ 2025-10-02 9:18 Alexandr Sapozhnkiov
2025-10-03 15:00 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Alexandr Sapozhnkiov @ 2025-10-02 9:18 UTC (permalink / raw)
To: Alexandre Belloni, linux-rtc, linux-kernel
Cc: Alexandr Sapozhnikov, lvc-project
From: Alexandr Sapozhnikov <alsp705@gmail.com>
The regmap_raw_read() function may return an error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
---
drivers/rtc/rtc-88pm80x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index f40cc06b0979..3651dc8436f0 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -153,7 +153,9 @@ static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
(buf[1] << 8) | buf[0];
dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]);
- regmap_raw_read(info->map, PM800_RTC_EXPIRE1_1, buf, 4);
+ ret = regmap_raw_read(info->map, PM800_RTC_EXPIRE1_1, buf, 4);
+ if (ret)
+ return ret;
data = ((unsigned long)buf[3] << 24) | (buf[2] << 16) |
(buf[1] << 8) | buf[0];
ticks = base + data;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: fix error return in pm80x_rtc_read_alarm()
2025-10-02 9:18 Alexandr Sapozhnkiov
@ 2025-10-03 15:00 ` Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-10-03 15:00 UTC (permalink / raw)
To: Alexandr Sapozhnikov, linux-rtc, lvc-project; +Cc: LKML, Alexandre Belloni
> The regmap_raw_read() function may return an error.
* Would a corresponding imperative wording become helpful for an improved change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17#n94
* How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-03 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 9:18 [PATCH] rtc: fix error return in pm80x_rtc_read_alarm() Alexandr Sapozhnkiov
-- strict thread matches above, loose matches on Subject: below --
2025-10-02 9:18 Alexandr Sapozhnkiov
2025-10-03 15:00 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).