[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250408144203.3869821-1-alexandre.belloni@bootlin.com>
Date: Tue, 8 Apr 2025 16:42:03 +0200
From: alexandre.belloni@...tlin.com
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] rtc: interface: silence KMSAN warning
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
KMSAN complains that alarm->time can be used uninitialized. Pass 0 to
trace_rtc_read_alarm in case it has not been set.
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
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 aaf76406cd7d..dc741ba29fa3 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.48.1
Powered by blists - more mailing lists