diff mbox

lpc-rtc: zero out struct tm before read

Message ID 1447740435-25617-1-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Nov. 17, 2015, 6:07 a.m. UTC
Picked up by static analysis. Never in a billion years would this
affect the real world.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hw/lpc-rtc.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/lpc-rtc.c b/hw/lpc-rtc.c
index 63124dfe79fb..95506cd10e40 100644
--- a/hw/lpc-rtc.c
+++ b/hw/lpc-rtc.c
@@ -119,6 +119,8 @@  static void lpc_init_time(void)
 	struct tm tm;
 	bool valid;
 
+	memset(&tm, 0, sizeof(tm));
+
 	lock(&rtc_lock);
 
 	/* If update is in progress, wait a bit */