rtc: fix error return in pm80x_rtc_read_alarm()
PATCH 1/1 rtc: fix error return in pm80x_rtc_read_alarm()
From: Alexandr Sapozhnikov <[email protected]>
The regmap_raw_read() function may return an error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexandr Sapozhnikov <[email protected]>
--- drivers/rtc/rtc-88pm80x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rtc/rtc-88pm80x.c +3 -1
@@ -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;
Signature · 1 line
2.43.0
Quoted 1 line
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