Skip to content
Commit 7ce9a992 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Alexandre Belloni
Browse files

rtc: hctosys: Add missing range error reporting



Fix an issue with the 32-bit range error path in `rtc_hctosys' where no
error code is set and consequently the successful preceding call result
from `rtc_read_time' is propagated to `rtc_hctosys_ret'.  This in turn
makes any subsequent call to `hctosys_show' incorrectly report in sysfs
that the system time has been set from this RTC while it has not.

Set the error to ERANGE then if we can't express the result due to an
overflow.

Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Fixes: b3a5ac42 ("rtc: hctosys: Ensure system time doesn't overflow time_t")
Cc: stable@vger.kernel.org # 4.17+
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent fbb974ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment