[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <159796143347.2239022.2687430267906057170.b4-ty@bootlin.com>
Date: Fri, 21 Aug 2020 00:10:48 +0200
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: LKML <linux-kernel@...r.kernel.org>,
Victor Ding <victording@...gle.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-rtc@...r.kernel.org, Alessandro Zummo <a.zummo@...ertech.it>
Subject: Re: [PATCH v2] rtc: cmos: zero-init wkalrm when reading from CMOS
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@...tlin.com>
Powered by blists - more mailing lists