[Skiboot] [PATCH] lpc-rtc: zero out struct tm before read

Stewart Smith stewart at linux.vnet.ibm.com
Tue Nov 17 17:07:15 AEDT 2015


Picked up by static analysis. Never in a billion years would this
affect the real world.

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

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 */
-- 
2.1.4



More information about the Skiboot mailing list