]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: interface: silence KMSAN warning
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 8 Apr 2025 14:42:03 +0000 (16:42 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 24 May 2025 21:31:12 +0000 (23:31 +0200)
KMSAN complains that alarm->time can be used uninitialized. Pass 0 to
trace_rtc_read_alarm in case it has not been set.

Link: https://lore.kernel.org/r/20250408144203.3869821-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/interface.c

index aaf76406cd7d7d2cfd5479fc1fc892fcb5efbb6b..dc741ba29fa35f3c3ad521231909758537655f4e 100644 (file)
@@ -205,7 +205,7 @@ static int rtc_read_alarm_internal(struct rtc_device *rtc,
 
        mutex_unlock(&rtc->ops_lock);
 
-       trace_rtc_read_alarm(rtc_tm_to_time64(&alarm->time), err);
+       trace_rtc_read_alarm(err?0:rtc_tm_to_time64(&alarm->time), err);
        return err;
 }