lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] rtc: cmos: zero-init wkalrm when reading from CMOS
Date
On Fri, 14 Aug 2020 19:17:30 +1000, Victor Ding wrote:
> cmos_read_alarm() may leave certain fields of a struct rtc_wkalrm
> untouched; therefore, these fields contain garbage if not properly
> initialized, leading to inconsistent values when converting into
> time64_t. This patch to zero initialize the struct before calling
> cmos_read_alarm().
>
> Note that this patch is not intended to produce a correct time64_t, it
> is only to produce a consistent value. In the case of suspend/resume, a
> correct time64_t is not necessary; a consistent value is sufficient to
> correctly perform an equality test for t_current_expires and
> t_saved_expires. Logic to deduce a correct time64_t is expensive and
> hence should be avoided.

Applied, thanks!

[1/1] rtc: cmos: zero-init wkalrm when reading from CMOS
commit: c254bcd7231a3eeafc453f6ee3a483a2e7ff486e

Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>

\
 
 \ /
  Last update: 2020-08-21 00:11    [W:2.553 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site