From d8a0f6af1d36806d05883bdc5684aeae3689f927 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Tue, 8 Apr 2025 16:42:03 +0200 Subject: [PATCH] rtc: interface: silence KMSAN warning 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 --- drivers/rtc/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index aaf76406cd7d7..dc741ba29fa35 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -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; } -- 2.47.2