From a7a9c463fd4cecd4152868fdd760030bf8970e43 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Tue, 26 Jul 2016 09:03:25 -0600 Subject: rockchip/common: Set weekday to unknown in rtc_get() Prior to this patch, time->wday was not being initialized in rtc_get(), but was still being used by rtc_display() to print a day. Set to -1 which gets printed as "unknown ". Fixes coverity issue 1357459 - Uninitialized scalar variable Change-Id: Idecb7968f854df997b58a342e1a06a879f299394 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/15899 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Paul Menzel Reviewed-by: Julius Werner --- src/soc/rockchip/common/rk808.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/soc/rockchip/common/rk808.c b/src/soc/rockchip/common/rk808.c index 562e76b720..dc6b2ea23f 100644 --- a/src/soc/rockchip/common/rk808.c +++ b/src/soc/rockchip/common/rk808.c @@ -199,5 +199,7 @@ int rtc_get(struct rtc_time *time) ret |= rk808_read(RTC_YEAR, &value); time->year = bcd2bin(value); + time->wday = -1; /* unknown */ + return ret; } -- cgit v1.2.3