Skip to content
Commit 9aa0d0be authored by Nick Crews's avatar Nick Crews Committed by Alexandre Belloni
Browse files

rtc: wilco-ec: Handle reading invalid times



If the RTC HW returns an invalid time, the rtc_year_days()
call would crash. This patch adds error logging in this
situation, and removes the tm_yday and tm_wday calculations.
These fields should not be relied upon by userspace
according to man rtc, and thus we don't need to calculate
them.

Signed-off-by: default avatarNick Crews <ncrews@chromium.org>
Reviewed-by: default avatarDaniel Campello <campello@chromium.org>
Link: https://lore.kernel.org/r/20191004142608.170159-1-ncrews@chromium.org


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 147dae76
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment