[lvc-project] [PATCH] rtc: fix error return in pm80x_rtc_set_time()
Alexandr Sapozhnkiov
alsp705 at gmail.com
Thu Oct 2 12:19:59 MSK 2025
From: Alexandr Sapozhnikov <alsp705 at gmail.com>
The regmap_raw_write() function may return an error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705 at gmail.com>
---
drivers/rtc/rtc-88pm80x.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index f40cc06b0979..71d4cc7e595c 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -136,9 +136,7 @@ static int pm80x_rtc_set_time(struct device *dev, struct rtc_time *tm)
buf[1] = (base >> 8) & 0xFF;
buf[2] = (base >> 16) & 0xFF;
buf[3] = (base >> 24) & 0xFF;
- regmap_raw_write(info->map, PM800_RTC_EXPIRE2_1, buf, 4);
-
- return 0;
+ return regmap_raw_write(info->map, PM800_RTC_EXPIRE2_1, buf, 4);
}
static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
--
2.43.0
More information about the lvc-project
mailing list