[coreboot-gerrit] New patch to review for coreboot: rockchip/common: Set weekday to unknown in rtc_get()
Martin Roth (martinroth@google.com)
gerrit at coreboot.org
Tue Jul 26 17:04:09 CEST 2016
Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15899
-gerrit
commit fcb588f5031982da9ef03451842acb4399036490
Author: Martin Roth <martinroth at google.com>
Date: Tue Jul 26 09:03:25 2016 -0600
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 <martinroth at google.com>
---
src/soc/rockchip/common/rk808.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/soc/rockchip/common/rk808.c b/src/soc/rockchip/common/rk808.c
index 562e76b..dc6b2ea 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;
}
More information about the coreboot-gerrit
mailing list