[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/6] mc146818rtc: rtc_set_time(): initialize tm to zeroes
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 3/6] mc146818rtc: rtc_set_time(): initialize tm to zeroes |
Date: |
Tue, 17 Oct 2023 15:59:38 +0300 |
set_time() function doesn't set all the fields, so it's better to
initialize tm structure. And Coverity will be happier about it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Maksim Davydov <davydov-max@yandex-team.ru>
---
hw/rtc/mc146818rtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index c27c362db9..2d391a8396 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -599,7 +599,7 @@ static void rtc_get_time(MC146818RtcState *s, struct tm *tm)
static void rtc_set_time(MC146818RtcState *s)
{
- struct tm tm;
+ struct tm tm = {};
g_autofree const char *qom_path = object_get_canonical_path(OBJECT(s));
rtc_get_time(s, &tm);
--
2.34.1
- [PATCH v3 0/6] coverity fixes, Vladimir Sementsov-Ogievskiy, 2023/10/17
- [PATCH v3 3/6] mc146818rtc: rtc_set_time(): initialize tm to zeroes,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v3 1/6] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): assert no overflow, Vladimir Sementsov-Ogievskiy, 2023/10/17
- [PATCH v3 6/6] io/channel-socket: qio_channel_socket_flush(): improve msg validation, Vladimir Sementsov-Ogievskiy, 2023/10/17
- [PATCH v3 2/6] util/filemonitor-inotify: qemu_file_monitor_watch(): assert no overflow, Vladimir Sementsov-Ogievskiy, 2023/10/17
- [PATCH v3 5/6] hw/core/loader: gunzip(): initialize z_stream, Vladimir Sementsov-Ogievskiy, 2023/10/17
- [PATCH v3 4/6] block/nvme: nvme_process_completion() fix bound for cid, Vladimir Sementsov-Ogievskiy, 2023/10/17